home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / mail / mh / updates / MH.6.8.1.Z / MH.6.8.1
Encoding:
Text File  |  1993-08-19  |  169.8 KB  |  6,698 lines

  1. *** ../mh-6.8/Patchlevel    Tue Dec 15 08:52:42 1992
  2. --- Patchlevel    Thu Aug 19 16:46:19 1993
  3. ***************
  4. *** 1 ****
  5. ! MH.6.8 patch.0
  6. --- 1 ----
  7. ! MH.6.8 patch.1
  8. *** ../mh-6.8/papers/changes/mh-changes.ms    Tue Dec 15 08:54:32 1992
  9. --- papers/changes/mh-changes.ms    Fri Aug 20 10:11:06 1993
  10. ***************
  11. *** 1,2 ****
  12. ! .\" @(#)$Id: mh-changes.ms,v 1.25 1992/12/15 00:25:33 jromine Exp $
  13.   .\" Standard -ms macros
  14. --- 1,2 ----
  15. ! .\" @(#)$Id: mh-changes.ms,v 1.26 1993/08/20 17:11:02 jromine Exp $
  16.   .\" Standard -ms macros
  17. ***************
  18. *** 6,8 ****
  19.   .\" remember to update date in text below
  20. ! .DA "December 14, 1992"
  21.   .if n \{\
  22. --- 6,8 ----
  23.   .\" remember to update date in text below
  24. ! .DA "August 20, 1993"
  25.   .if n \{\
  26. ***************
  27. *** 30,31 ****
  28. --- 30,32 ----
  29.   Irvine, CA  92717\-3425
  30. + Bug-MH@ICS.UCI.EDU
  31.   .AB
  32. ***************
  33. *** 98,99 ****
  34. --- 99,161 ----
  35.   .KE
  36. + .ds LH Changes for MH 6.8.1
  37. + .bp
  38. + .SH
  39. + CHANGES FOR MH 6.8.1
  40. + .LP
  41. + The MH.6.8.1 patch release is a maintenance
  42. + release.
  43. + This is the current released version of \fIMH\fP
  44. + as of August 20, 1993.
  45. + .PP
  46. + This release includes a small number
  47. + of bug fixes, a few minor enhancements, some changes
  48. + for the new MIME standard, and support for ESMTP (RFC 1425).
  49. + Support for BSD 4.4 and 386BSD is planned for the next
  50. + release.
  51. + .PP
  52. + Many other fixes which have already been received
  53. + are still being merged.
  54. + If you've sent an update for MH 6.8 to \fBBug-MH@ics.uci.edu\fP
  55. + and it isn't in this release,
  56. + it'll probably appear in the next release.
  57. + .SH
  58. + Fixes and Enhancements
  59. + .LP
  60. + Many minor documentation corrections were made.
  61. + There are also a few program changes:
  62. + .IP mhn \w'post'u+2n
  63. + The `\-cache\0policy', `\-\[no\]check', and `\-\[no\]pause'
  64. + switches have been added.   Some other minor changes have
  65. + been made to comply with the new MIME standard.
  66. + See \fImhn\fP\|(1) for complete details.
  67. + .IP post 
  68. + When posting mail with SendMail, \fIpost\fP will
  69. + not use the \fBONEX\fP command when it is posting 
  70. + a message with BCCs.
  71. + .IP scan
  72. + \fIscan\fP will now work with big width values.
  73. + .SH 
  74. + Format Strings
  75. + .LP
  76. + One new function has been added:
  77. + .IP "%(profile arg)" \w'XXprofileXargX'u+2n
  78. + This function looks up a component in the 
  79. + \fB\&.mh\(ruprofile\fR or \fBcontext\fP files
  80. + and returns the value of that component.
  81. + .SH
  82. + Configuration
  83. + .LP
  84. + Two new configuration options are present:
  85. + .IP GCOS_HACK \w'NORUSERPASS'u+2n
  86. + The so-called \*(lqgcos\*(rq field of the password file is 
  87. + used as a last resort
  88. + to find the user's full name (see \fImh-profile\fP\|(5) for details).
  89. + Enable this option
  90. + if your \fIpasswd\fP\|(5) man page notes that the `&'
  91. + character in the \*(lqgcos\*(rq field stands for the login name.
  92. + .IP NORUSERPASS
  93. + Tells \fIMH\fR that your system doesn't have the
  94. + \fIruserpass\fP\|(3) routine;
  95. + \fIMH\fR will include its own copy of this
  96. + routine in its library.
  97.   .ds LH Changes for MH 6.8
  98. ***************
  99. *** 100,101 ****
  100. --- 162,164 ----
  101.   .bp
  102. + .ds CF December 14, 1992
  103.   .SH
  104. *** ../mh-6.8/conf/mh-gen.8    Tue Dec 15 08:53:15 1992
  105. --- conf/mh-gen.8    Fri Aug 20 12:48:02 1993
  106. ***************
  107. *** 1,2 ****
  108. ! .\" @(#)$Id: mh-gen.8,v 2.105 1992/12/14 17:19:19 jromine Exp $
  109.   .\" uneven inter-word spacing (nroff line adjusting) hampers readability
  110. --- 1,2 ----
  111. ! .\" @(#)$Id: mh-gen.8,v 2.111 1993/08/20 19:47:56 jromine Exp $
  112.   .\" uneven inter-word spacing (nroff line adjusting) hampers readability
  113. ***************
  114. *** 3,5 ****
  115.   .if n .na
  116. ! .TH MH-GEN 8 MH.6.8 [mh.6]
  117.   .SH NAME
  118. --- 3,5 ----
  119.   .if n .na
  120. ! .TH MH-GEN 8 MH.6.8.1 [mh.6]
  121.   .SH NAME
  122. ***************
  123. *** 194,195 ****
  124. --- 194,196 ----
  125.   or \*(lqstandard\*(rq to install manual entries under \fBman?/\fR,
  126. + or \*(lqbsd44\*(rq to install manual entries as \fBman?/\fIpage\fP.0\fR,
  127.   or \*(lqgen\*(rq to generate but not install them,
  128. ***************
  129. *** 196,197 ****
  130. --- 197,204 ----
  131.   or \*(lqnone\*(rq to neither generate nor install them.
  132. + Any of these values may have the suffix \*(lq/cat\*(rq appended 
  133. + to it.   In that case, the manual entries will be formatted
  134. + with \*(lqnroff -man\*(rq and they will be installed in the
  135. + corresponding \*(lqcat?\*(rq directories.
  136.   For example,
  137. ***************
  138. *** 199,200 ****
  139. --- 206,211 ----
  140.   use \*(lqstandard\*(rq and \fB/usr/man/u_man\fR for \*(lqmandir\*(rq.
  141. + To install formatted manual entires under \fB/usr/contrib/man/cat?\fR,
  142. + use \*(lqstandard/cat\*(rq and \fB/usr/contrib/man\fR for \*(lqmandir\*(rq.
  143. + To install formatted manual entries using the BSD44 convention,
  144. + use \*(lqbsd44/cat\*(rq.
  145.   
  146. ***************
  147. *** 648,650 ****
  148.   Use on Berkeley UNIX systems on or after 4.4BSD.
  149. ! This code is still under development.
  150.   
  151. --- 659,662 ----
  152.   Use on Berkeley UNIX systems on or after 4.4BSD.
  153. ! Also, be sure to use \*(lqoptions BSD43\*(rq
  154. ! and \*(lqoptions BSD42\*(rq.
  155.   
  156. ***************
  157. *** 664,665 ****
  158. --- 676,687 ----
  159.   
  160. + .ti -.5in
  161. + GCOS_HACK
  162. + .br
  163. + The so-called \*(lqgcos\*(rq field of the password file is 
  164. + used as a last resort
  165. + to find the user's full name (see \fImh-profile\fP\|(5) for details).
  166. + Enable this option
  167. + if your \fIpasswd\fP\|(5) man page notes that the `&'
  168. + character in the \*(lqgcos\*(rq field stands for the login name.
  169.   .ti -.5i
  170. ***************
  171. *** 725,727 ****
  172.   If you get an undefined symbol \*(lqruserpass\*(rq when compiling
  173. ! \fIMH\fP, you need this option.  If, however, you include this
  174.   option and get an undefined symbol \*(lq\(ru\^\(ruruserpass\*(rq
  175. --- 747,749 ----
  176.   If you get an undefined symbol \*(lqruserpass\*(rq when compiling
  177. ! \fIMH\fP, you probably need this option.  If, however, you include this
  178.   option and get an undefined symbol \*(lq\(ru\^\(ruruserpass\*(rq
  179. ***************
  180. *** 728,729 ****
  181. --- 750,752 ----
  182.   when compiling, then you should omit this option.
  183. + (See also `NORUSERPASS'.)
  184.   
  185. ***************
  186. *** 736,737 ****
  187. --- 759,769 ----
  188.   .ti -.5i
  189. + NORUSERPASS
  190. + .br
  191. + Tells \fIMH\fR that your system doesn't have the
  192. + \fIruserpass\fP\|(3) routine;
  193. + \fIMH\fR will include its own copy of this
  194. + routine in its library.
  195. + (See also `NFS'.)
  196. + .ti -.5i
  197.   NTOHLSWAP
  198. ***************
  199. *** 760,761 ****
  200. --- 792,804 ----
  201.   
  202. + .\" .ti -.5i
  203. + .\" SMTP_ONEX
  204. + .\" .br
  205. + .\" Causes \fIMH\fP to give the \*(lqONEX\*(rq SMTP command
  206. + .\" when posting mail (a SendMail performance hack).
  207. + .\" Useful only if you're running a SendMail
  208. + .\" which will successfully reset with the \*(lqRSET\*(rq command
  209. + .\" after seeing the \*(lqONEX\*(rq command;
  210. + .\" otherwise, if you enable this 
  211. + .\" you may have problems posting messages with \*(lqBCCs\*(rq.
  212. + .\" 
  213.   .ti -.5i
  214. *** ../mh-6.8/conf/mhconfig.c    Tue Dec 15 08:53:16 1992
  215. --- conf/mhconfig.c    Fri Aug 20 12:47:50 1993
  216. ***************
  217. *** 1,7 ****
  218.   /* mhconfig.c - configure MH */
  219.   /* cc [-DSYS5] mhconfig.c -o mhconfig */
  220.   #ifndef    lint
  221. ! static char ident[] = "@(#)$Id: mhconfig.c,v 2.63 1992/12/02 19:08:03 jromine Exp $";
  222.   #endif    /* lint */
  223.   
  224.   #include <ctype.h>
  225. --- 1,7 ----
  226.   /* mhconfig.c - configure MH */
  227.   /* cc [-DSYS5] mhconfig.c -o mhconfig */
  228.   #ifndef    lint
  229. ! static char ident[] = "@(#)$Id: mhconfig.c,v 2.69 1993/08/20 19:47:46 jromine Exp $";
  230.   #endif    /* lint */
  231.   
  232.   #include <ctype.h>
  233. ***************
  234. *** 29,35 ****
  235.   #define    MAKE        "../%s/Makefile"
  236.   
  237.   #define    WARNING    "This file is automatically generated.  Do not edit!"
  238. ! #define    MHRELEASE    "6.8"        /* for version: "Maj.min.pat" */
  239.   #define    MHCENTERFOOT    "MH.6.8"    /* for nroff page footers */
  240.   #define    MHLEFTFOOT    "[mh.6]"    /* [mh.6]    MH.6.6   page# */
  241.   #define    MHSLIBVER    "3.2"        /* SunOS4 shared library version */
  242. --- 29,35 ----
  243.   #define    MAKE        "../%s/Makefile"
  244.   
  245.   #define    WARNING    "This file is automatically generated.  Do not edit!"
  246. ! #define    MHRELEASE    "6.8.1"        /* for version: "Maj.min.pat" */
  247.   #define    MHCENTERFOOT    "MH.6.8"    /* for nroff page footers */
  248.   #define    MHLEFTFOOT    "[mh.6]"    /* [mh.6]    MH.6.6   page# */
  249.   #define    MHSLIBVER    "3.2"        /* SunOS4 shared library version */
  250. ***************
  251. *** 76,81 ****
  252. --- 76,82 ----
  253.   static char *mailpath = "/usr/spool/mail";
  254.   static char *maildir = NULL;
  255.   static char *mailfile = NULL;
  256. + static char *mancat = "man";
  257.   static char *mandir = "/usr/man";
  258.   static char *manuals = "standard";
  259.   static char *mf = "off";
  260. ***************
  261. *** 136,141 ****
  262. --- 137,143 ----
  263.       "MIME", 0,    /* multi-media extensions */
  264.       "MPOP", 0,    /* mobile pop */
  265.       "MSGID", 0, /* slocal dup surpression */
  266. +     "NORUSERPASS", 0, /* no ruserpass(3) */
  267.       "TMA", 0,    /* trusted mail */
  268.       "TTYD", 0,
  269.       "UCI", 0,
  270. ***************
  271. *** 336,355 ****
  272.       maildir ? maildir : "/usr/spool/mail");
  273.   
  274.       fprintf (fp, "s%%@(MHMANDIR)%%%s%%g\n", mandir);
  275.       if (strcmp (manuals, "standard") == 0 || strcmp (manuals, "gen") == 0)
  276.       for (i = 1; i <= 8; i++) {
  277. !         fprintf (fp, "s%%@(MHMANDIR%d)%%man%d%%g\n", i, i);
  278.           fprintf (fp, "s%%@(MHMANEXT%d)%%%d%%g\n", i, i);
  279.       }
  280.       else
  281.       for (i = 1; i <= 8; i++) {
  282. !         fprintf (fp, "s%%@(MHMANDIR%d)%%man%c%%g\n", i,
  283.               strcmp (manuals, "new") == 0 ? 'n'
  284.               : strcmp (manuals, "old") == 0 ? 'o'
  285.               : 'l');
  286.           fprintf (fp, "s%%@(MHMANEXT%d)%%%c%%g\n", i,
  287.               strcmp (manuals, "new") == 0 ? 'n'
  288.               : strcmp (manuals, "old") == 0 ? 'o'
  289.               : 'l');
  290.       }
  291.   
  292. --- 338,361 ----
  293.       maildir ? maildir : "/usr/spool/mail");
  294.   
  295.       fprintf (fp, "s%%@(MHMANDIR)%%%s%%g\n", mandir);
  296. +     fprintf (fp, "s%%@(MHCATMAN)%%%s%%g\n",
  297. +     strcmp(mancat, "cat") == 0 ? "| nroff -man" : "");
  298.       if (strcmp (manuals, "standard") == 0 || strcmp (manuals, "gen") == 0)
  299.       for (i = 1; i <= 8; i++) {
  300. !         fprintf (fp, "s%%@(MHMANDIR%d)%%%s%d%%g\n", i, mancat, i);
  301.           fprintf (fp, "s%%@(MHMANEXT%d)%%%d%%g\n", i, i);
  302.       }
  303.       else
  304.       for (i = 1; i <= 8; i++) {
  305. !         fprintf (fp, "s%%@(MHMANDIR%d)%%%s%c%%g\n", i, mancat,
  306.               strcmp (manuals, "new") == 0 ? 'n'
  307.               : strcmp (manuals, "old") == 0 ? 'o'
  308. +             : strcmp (manuals, "bsd44") == 0 ? i + '0'
  309.               : 'l');
  310.           fprintf (fp, "s%%@(MHMANEXT%d)%%%c%%g\n", i,
  311.               strcmp (manuals, "new") == 0 ? 'n'
  312.               : strcmp (manuals, "old") == 0 ? 'o'
  313. +             : strcmp (manuals, "bsd44") == 0 ? '0'
  314.               : 'l');
  315.       }
  316.   
  317. ***************
  318. *** 360,366 ****
  319.       else
  320.       fprintf (fp, "s%%@(MHHOSTVER)%%%s%%g\n", "");
  321.   
  322. !     if (strcmp (manuals, "gen") == 0 || strcmp (manuals, "gen") == 0)
  323.       fprintf (fp, "s%%@(MHMANGEN)%%%s%%g\n", "#"); /* comment char */
  324.       else
  325.       fprintf (fp, "s%%@(MHMANGEN)%%%s%%g\n", "");
  326. --- 366,372 ----
  327.       else
  328.       fprintf (fp, "s%%@(MHHOSTVER)%%%s%%g\n", "");
  329.   
  330. !     if (strcmp (manuals, "gen") == 0 || strcmp (manuals, "none") == 0)
  331.       fprintf (fp, "s%%@(MHMANGEN)%%%s%%g\n", "#"); /* comment char */
  332.       else
  333.       fprintf (fp, "s%%@(MHMANGEN)%%%s%%g\n", "");
  334. ***************
  335. *** 708,714 ****
  336. --- 714,727 ----
  337.       else
  338.       mailfile = mailpath;
  339.   
  340. +     if (cp = index (manuals, '/')) {    /* "standard/cat" */
  341. +     *cp++ = 0;
  342. +     mancat = cp;
  343. +     if (strcmp (mancat, "cat"))
  344. +         adios (NULLCP,"invalid manuals setting: %s/%s",manuals, mancat);
  345. +     }
  346.       if (strcmp (manuals, "standard")
  347. +         && strcmp (manuals, "bsd44")
  348.           && strcmp (manuals, "local")
  349.           && strcmp (manuals, "new")
  350.           && strcmp (manuals, "old")
  351. *** ../mh-6.8/conf/config/mts.c    Tue Dec 15 08:52:44 1992
  352. --- conf/config/mts.c    Fri Aug 20 09:14:02 1993
  353. ***************
  354. *** 1,6 ****
  355.   /* mts.c - definitions for the mail transport system */
  356.   #ifndef    lint
  357. ! static char ident[] = "@(#)$Id: mts.c,v 2.16 1992/11/24 18:40:34 jromine Exp $";
  358.   #endif /* lint */
  359.   
  360.   /* LINTLIBRARY */
  361. --- 1,6 ----
  362.   /* mts.c - definitions for the mail transport system */
  363.   #ifndef    lint
  364. ! static char ident[] = "@(#)$Id: mts.c,v 2.18 1993/08/19 23:36:12 jromine Exp $";
  365.   #endif /* lint */
  366.   
  367.   /* LINTLIBRARY */
  368. ***************
  369. *** 502,509 ****
  370. --- 502,522 ----
  371.       }
  372.   
  373.       np = pw -> pw_gecos;
  374. + #ifndef    GCOS_HACK
  375.       for (cp = fullname; *np && *np != (MMailids ? '<' : ','); *cp++ = *np++)
  376.       continue;
  377. + #else
  378. +     for (cp = fullname; *np && *np != (MMailids ? '<' : ','); )
  379. +     if (*np == '&')    {    /* blech! */
  380. +         (void) strcpy(cp, pw -> pw_name);
  381. +         *cp = toupper(*cp);
  382. +         while (*cp)
  383. +         cp++;
  384. +         np++;
  385. +     }
  386. +     else
  387. +         *cp++ = *np++;
  388. + #endif
  389.       *cp = '\0';
  390.       if (MMailids) {
  391.       if (*np)
  392. *** ../mh-6.8/conf/doc/folder.rf    Tue Dec 15 08:52:49 1992
  393. --- conf/doc/folder.rf    Thu Aug 19 14:20:57 1993
  394. ***************
  395. *** 1,3 ****
  396.   .\"    @(MHWARNING)
  397. ! .\" @(#)$Id: folder.rf,v 1.11 1992/10/29 21:50:27 jromine Exp $
  398.   .SC FOLDER 1
  399. --- 1,3 ----
  400.   .\"    @(MHWARNING)
  401. ! .\" @(#)$Id: folder.rf,v 1.12 1993/08/19 21:20:51 jromine Exp $
  402.   .SC FOLDER 1
  403. ***************
  404. *** 198,200 ****
  405.   .Bu
  406. ! `\-all' forces `\-header'.
  407.   .En
  408. --- 198,200 ----
  409.   .Bu
  410. ! `\-all' forces `\-header' and `\-total'.
  411.   .En
  412. *** ../mh-6.8/conf/doc/mark.rf    Tue Dec 15 08:52:50 1992
  413. --- conf/doc/mark.rf    Thu Aug 19 17:04:32 1993
  414. ***************
  415. *** 1,3 ****
  416.   .\"    @(MHWARNING)
  417. ! .\" @(#)$Id: mark.rf,v 1.7 1992/02/12 00:23:13 jromine Exp $
  418.   .SC MARK 1
  419. --- 1,3 ----
  420.   .\"    @(MHWARNING)
  421. ! .\" @(#)$Id: mark.rf,v 1.9 1993/08/20 00:04:30 jromine Exp $
  422.   .SC MARK 1
  423. ***************
  424. *** 83,87 ****
  425.   an alphabetic character followed by zero or more
  426. ! alphanumeric characters, and can not be one of the \*(lqreserved\*(rq
  427. ! message names
  428. ! (e.g., \*(lqfirst\*(rq, \*(lqcur\*(rq, and so forth).
  429.   
  430. --- 83,87 ----
  431.   an alphabetic character followed by zero or more
  432. ! alphanumeric characters, and cannot be one of the (reserved)
  433. ! message names \*(lqnew\*(rq, \*(lqfirst\*(rq,
  434. ! \*(lqlast\*(rq, \*(lqall\*(rq, \*(lqnext\*(rq, or \*(lqprev\*(rq.
  435.   
  436. *** ../mh-6.8/conf/doc/mh-chart.rf    Tue Dec 15 08:52:51 1992
  437. --- conf/doc/mh-chart.rf    Fri Aug 20 10:13:35 1993
  438. ***************
  439. *** 1,3 ****
  440.   .\"    @(MHWARNING)
  441. ! .\" @(#)$Id: mh-chart.rf,v 2.18 1992/11/11 17:34:01 jromine Exp $
  442.   .if '\*(ZZ'-man' \{\
  443. --- 1,3 ----
  444.   .\"    @(MHWARNING)
  445. ! .\" @(#)$Id: mh-chart.rf,v 2.19 1993/08/20 17:13:30 jromine Exp $
  446.   .if '\*(ZZ'-man' \{\
  447. ***************
  448. *** 240,242 ****
  449.   .br
  450. ! \%[\-list\0\%[\-header]\0\%[\-noheader]
  451.   .br
  452. --- 240,242 ----
  453.   .br
  454. ! \%[\-list\0\%[\-headers]\0\%[\-noheaders]
  455.   .br
  456. ***************
  457. *** 244,248 ****
  458.   .br
  459. ! \%[\-show\0\%[\-serialonly]\0\%[\-noserialonly]]
  460.   .br
  461. !        \%[\-form\0formfile]] \%[\-noshow]
  462.   .br
  463. --- 244,248 ----
  464.   .br
  465. ! \%[\-show\0\%[\-serialonly]\0\%[\-noserialonly]
  466.   .br
  467. !        \%[\-form\0formfile]\0\%[\-pause]\0\%[\-nopause]] \%[\-noshow]
  468.   .br
  469. ***************
  470. *** 250,255 ****
  471.   .br
  472. ! \%[\-verbose] \%[\-noverbose]
  473. ! \%[\-rfc934mode] \%[\-norfc934mode]
  474. ! \%[\-ebcdic] \%[\-noebcdicsafe]
  475. ! .br
  476.   \%[\-help]
  477. --- 250,256 ----
  478.   .br
  479. ! \%[\-cache\0policy]
  480. ! \%[\-check]\0\%[\-nocheck]
  481. ! \%[\-ebcdicsafe]\0\%[\-noebcdicsafe]
  482. ! \%[\-rfc934mode]\0\%[\-norfc934mode]
  483. ! \%[\-verbose]\0\%[\-noverbose]
  484.   \%[\-help]
  485. *** ../mh-6.8/conf/doc/mh-format.rf    Tue Dec 15 08:52:51 1992
  486. --- conf/doc/mh-format.rf    Thu Aug 19 13:26:27 1993
  487. ***************
  488. *** 1,3 ****
  489.   .\"    @(MHWARNING)
  490. ! .\" @(#)$Id: mh-format.rf,v 1.43 1992/12/02 18:41:50 jromine Exp $
  491.   .SC MH-FORMAT 5
  492. --- 1,3 ----
  493.   .\"    @(MHWARNING)
  494. ! .\" @(#)$Id: mh-format.rf,v 1.45 1993/08/19 20:26:17 jromine Exp $
  495.   .SC MH-FORMAT 5
  496. ***************
  497. *** 207,208 ****
  498. --- 207,209 ----
  499.   getenv     literal    string    Set \fIstr\fR to environment value of \fIarg\fR
  500. + profile    literal    string    Set \fIstr\fR to profile component \fIarg\fR value
  501.   .\" dat    literal    int    return value of dat[arg]
  502. *** ../mh-6.8/conf/doc/mh-profile.rf    Tue Dec 15 08:52:52 1992
  503. --- conf/doc/mh-profile.rf    Thu Aug 19 16:43:43 1993
  504. ***************
  505. *** 1,3 ****
  506.   .\"    @(MHWARNING)
  507. ! .\" @(#)$Id: mh-profile.rf,v 1.19 1992/12/02 22:13:41 jromine Exp $
  508.   .SC MH-PROFILE 5
  509. --- 1,3 ----
  510.   .\"    @(MHWARNING)
  511. ! .\" @(#)$Id: mh-profile.rf,v 1.20 1993/08/19 23:43:36 jromine Exp $
  512.   .SC MH-PROFILE 5
  513. ***************
  514. *** 220,223 ****
  515.   This is superceded by the \fBSIGNATURE\fR envariable.
  516. ! On hosts where \fIMH\fR was configured with the UCI option,
  517. ! if \fBSIGNATURE\fR is not set and this profile entry is not present,
  518.   the file $HOME/.signature is consulted.
  519. --- 220,225 ----
  520.   This is superceded by the \fBSIGNATURE\fR envariable.
  521. ! If \fBSIGNATURE\fR is not set and this profile entry is not present,
  522. ! the \*(lqgcos\*(rq field of the \fI/etc/passwd\fP file will be used;
  523. ! otherwise,
  524. ! on hosts where \fIMH\fR was configured with the UCI option,
  525.   the file $HOME/.signature is consulted.
  526. *** ../mh-6.8/conf/doc/mhn.rf    Tue Dec 15 08:52:54 1992
  527. --- conf/doc/mhn.rf    Fri Aug 20 08:42:21 1993
  528. ***************
  529. *** 1,3 ****
  530.   .\"    @(MHWARNING)
  531. ! .\" @(#)$Id: mhn.rf,v 1.8 1992/12/10 23:59:10 jromine Exp $
  532.   .SC MHN 1
  533. --- 1,3 ----
  534.   .\"    @(MHWARNING)
  535. ! .\" @(#)$Id: mhn.rf,v 1.9 1993/08/20 15:42:08 jromine Exp $
  536.   .SC MHN 1
  537. ***************
  538. *** 13,17 ****
  539.   .br
  540. ! \%[\-show\0\%[\-serialonly]\0\%[\-noserialonly]]
  541.   .br
  542. !        \%[\-form\0formfile]] \%[\-noshow]
  543.   .br
  544. --- 13,17 ----
  545.   .br
  546. ! \%[\-show\0\%[\-serialonly]\0\%[\-noserialonly]
  547.   .br
  548. !        \%[\-form\0formfile]\0\%[\-pause]\0\%[\-nopause]] \%[\-noshow]
  549.   .br
  550. ***************
  551. *** 19,24 ****
  552.   .br
  553. ! \%[\-verbose] \%[\-noverbose]
  554. ! \%[\-rfc934mode] \%[\-norfc934mode]
  555. ! \%[\-ebcdicsafe] \%[\-noebcdicsafe]
  556.   .br
  557.   \%[\-help]
  558. --- 19,30 ----
  559.   .br
  560. ! \%[\-cache\0policy]
  561.   .br
  562. + \%[\-check]\0\%[\-nocheck]
  563. + .br
  564. + \%[\-ebcdicsafe]\0\%[\-noebcdicsafe]
  565. + .br
  566. + \%[\-rfc934mode]\0\%[\-norfc934mode]
  567. + .br
  568. + \%[\-verbose]\0\%[\-noverbose]
  569. + .br
  570.   \%[\-help]
  571. ***************
  572. *** 64,66 ****
  573.   message    rfc822, partial, external-body
  574. ! application    octet-stream, oda, postscript
  575.   image    jpeg, gif, x-pbm, x-pgm, x-ppm, x-xwd
  576. --- 70,72 ----
  577.   message    rfc822, partial, external-body
  578. ! application    octet-stream, postscript
  579.   image    jpeg, gif, x-pbm, x-pgm, x-ppm, x-xwd
  580. ***************
  581. *** 90,91 ****
  582. --- 96,101 ----
  583.   
  584. + Each content may optionally have an integrity check associated with it.
  585. + If present and the `-check' switch is given,
  586. + then \fImhn\fR will attempt to verify the integrity of the content.
  587.   .Uh "Listing the Contents"
  588. ***************
  589. *** 136,137 ****
  590. --- 146,148 ----
  591.   that content.
  592. + (The p-escape can be disabled by specifying `\-nopause'.)
  593.   Further,
  594. ***************
  595. *** 444,445 ****
  596. --- 455,463 ----
  597.   
  598. + The caching behavior of \fImhn\fR is controlled with the `\-cache' switch.
  599. + One of three arguments may be specified:
  600. + always, indicating that \fImhn\fR should make use of caching whenever possible;
  601. + ask, indicating that \fImhn\fR should ask the user;
  602. + and,
  603. + never, indicating that \fImhn\fR should never make use of caching.
  604.   .Uh "Composing the Contents"
  605. ***************
  606. *** 625,630 ****
  607.   name=    filename
  608. ! directory=    directoryname (optional)
  609.   site=    hostname
  610.   mode=    usually \fIascii\fR or \fIimage\fR (optional)
  611.   server=    mailbox
  612.   body=    command to send for retrieval
  613. --- 643,651 ----
  614.   name=    filename
  615. ! permission=    read-only or read-write
  616.   site=    hostname
  617. + directory=    directoryname (optional)
  618.   mode=    usually \fIascii\fR or \fIimage\fR (optional)
  619. + size=    number of octets
  620.   server=    mailbox
  621. + subject=    subject to send
  622.   body=    command to send for retrieval
  623. ***************
  624. *** 752,753 ****
  625. --- 773,777 ----
  626.   
  627. + If the `-check' switch is given,
  628. + \fImhn\fR will associate an integrity check with each content.
  629.   .Uh "Automatic Composition"
  630. ***************
  631. *** 1002,1003 ****
  632. --- 1026,1031 ----
  633.   .Ds
  634. + `\-cache\0ask'
  635. + .Ds
  636. + `\-nocheck'
  637. + .Ds
  638.   `\-noebcdicsafe'
  639. ***************
  640. *** 1007,1008 ****
  641. --- 1035,1038 ----
  642.   `\-headers'
  643. + .Ds
  644. + `\-pause'
  645.   .Ds
  646. *** ../mh-6.8/conf/doc/refile.rf    Tue Dec 15 08:52:58 1992
  647. --- conf/doc/refile.rf    Fri Dec 18 16:21:04 1992
  648. ***************
  649. *** 1,3 ****
  650.   .\"    @(MHWARNING)
  651. ! .\" @(#)$Id: refile.rf,v 1.11 1992/02/10 20:27:30 jromine Exp $
  652.   .SC REFILE 1
  653. --- 1,3 ----
  654.   .\"    @(MHWARNING)
  655. ! .\" @(#)$Id: refile.rf,v 1.12 1992/12/19 00:20:58 jromine Exp $
  656.   .SC REFILE 1
  657. ***************
  658. *** 52,54 ****
  659.   then \fIrefile\fR will not ask any questions and will proceed as if
  660. ! the user's answer was \*(lqyes\*(rq for all questions.
  661.   
  662. --- 52,54 ----
  663.   then \fIrefile\fR will not ask any questions and will proceed as if
  664. ! the user answered \*(lqyes\*(rq to all questions.
  665.   
  666. *** ../mh-6.8/conf/doc/scan.rf    Tue Dec 15 08:52:59 1992
  667. --- conf/doc/scan.rf    Thu Aug 19 13:43:29 1993
  668. ***************
  669. *** 1,3 ****
  670.   .\"    @(MHWARNING)
  671. ! .\" @(#)$Id: scan.rf,v 1.11 1992/10/29 22:01:56 jromine Exp $
  672.   .SC SCAN 1
  673. --- 1,3 ----
  674.   .\"    @(MHWARNING)
  675. ! .\" @(#)$Id: scan.rf,v 1.12 1993/08/19 20:43:27 jromine Exp $
  676.   .SC SCAN 1
  677. ***************
  678. *** 81,83 ****
  679.   To override the output format used by \fIscan\fR,
  680. ! the `\-format\ string' or `\-format\ file' switches are used.
  681.   This permits individual fields of the scan listing to be extracted with ease.
  682. --- 81,83 ----
  683.   To override the output format used by \fIscan\fR,
  684. ! the `\-format\ string' or `\-form\ file' switches are used.
  685.   This permits individual fields of the scan listing to be extracted with ease.
  686. *** ../mh-6.8/conf/examples/README    Tue Dec 15 08:53:03 1992
  687. --- conf/examples/README    Fri Feb 26 14:17:27 1993
  688. ***************
  689. *** 1,2 ****
  690. ! $Id: README,v 1.8 1992/12/14 18:12:18 jromine Exp $
  691.   These files are contributed MH config files from various sites.
  692. --- 1,2 ----
  693. ! $Id: README,v 1.8 1992/12/14 18:12:18 jromine Exp jromine $
  694.   These files are contributed MH config files from various sites.
  695. ***************
  696. *** 5,6 ****
  697. --- 5,7 ----
  698.   
  699. + # 386bsd        - MH 6.8, 386BSD system running SendMail
  700.   # aix.sap-ag.de    - MH 6.8 options for AIX (AIX 3.2 on RS/6000 350).
  701. ***************
  702. *** 10,11 ****
  703. --- 11,13 ----
  704.   # bsd43.uiuc.edu - MH 6.8 VAX running 4.3 BSD-reno
  705. + # bsd44.berkeley.edu - MH 6.8, 4.4BSD system running SendMail
  706.   # convex.uiuc.edu - MH 6.8 Convex C240 running ConvexOS v9.1
  707. *** ../mh-6.8/conf/makefiles/doc    Tue Dec 15 08:53:11 1992
  708. --- conf/makefiles/doc    Thu Jun  3 10:43:42 1993
  709. ***************
  710. *** 4,6 ****
  711.   #    @(MHWARNING)
  712. ! # @(#)$Id: doc,v 2.24 1992/10/28 17:01:04 jromine Exp $
  713.   ##############################################################################
  714. --- 4,6 ----
  715.   #    @(MHWARNING)
  716. ! # @(#)$Id: doc,v 2.25 1993/06/03 17:43:20 jromine Exp $
  717.   ##############################################################################
  718. ***************
  719. *** 134,136 ****
  720.   
  721. ! .me.man:;    cat tmac.me $< | sed -f me2man.sed > $@
  722.   
  723. --- 134,136 ----
  724.   
  725. ! .me.man:;    cat tmac.me $< | sed -f me2man.sed @(MHCATMAN) > $@
  726.   
  727. *** ../mh-6.8/conf/makefiles/sbr    Tue Dec 15 08:53:12 1992
  728. --- conf/makefiles/sbr    Fri Feb 26 11:01:32 1993
  729. ***************
  730. *** 4,6 ****
  731.   #    @(MHWARNING)
  732. ! # @(#)$Id: sbr,v 2.19 1992/11/12 22:47:24 jromine Exp $
  733.   ##############################################################################
  734. --- 4,6 ----
  735.   #    @(MHWARNING)
  736. ! # @(#)$Id: sbr,v 2.21 1993/02/26 19:01:31 jromine Exp $
  737.   ##############################################################################
  738. ***************
  739. *** 30,32 ****
  740.   SLIBVER    =    @(SLIBVER)
  741. ! SLIBDIR =    @(SLIBDIR)
  742.   SLFLAGS=    @(SLFLAGS)
  743. --- 30,32 ----
  744.   SLIBVER    =    @(SLIBVER)
  745. ! SLIBDIR =    $(DESTDIR)@(SLIBDIR)
  746.   SLFLAGS=    @(SLFLAGS)
  747. ***************
  748. *** 48,49 ****
  749. --- 48,52 ----
  750.           printsw.c push.c putenv.c pwd.c refile.c remdir.c r1bindex.c \
  751. + @BEGIN: NORUSERPASS
  752. +         ruserpass.c \
  753. + @END: NORUSERPASS
  754.           showfile.c smatch.c sprintb.c ssequal.c strindex.c trimcpy.c \
  755. ***************
  756. *** 64,65 ****
  757. --- 67,71 ----
  758.           printsw.o push.o putenv.o pwd.o refile.o remdir.o r1bindex.o \
  759. + @BEGIN: NORUSERPASS
  760. +         ruserpass.o \
  761. + @END: NORUSERPASS
  762.           showfile.o smatch.o sprintb.o ssequal.o strindex.o trimcpy.o \
  763. *** ../mh-6.8/conf/makefiles/support/general    Tue Dec 15 08:53:13 1992
  764. --- conf/makefiles/support/general    Fri Aug 20 08:56:28 1993
  765. ***************
  766. *** 4,6 ****
  767.   #    @(MHWARNING)
  768. ! # @(#)$Id: general,v 1.18 1992/10/28 18:56:06 jromine Exp $
  769.   ##############################################################################
  770. --- 4,6 ----
  771.   #    @(MHWARNING)
  772. ! # @(#)$Id: general,v 1.19 1993/08/20 15:56:25 jromine Exp $
  773.   ##############################################################################
  774. ***************
  775. *** 280,282 ****
  776.   $(ETCDIR)/mhn_defaults:    true
  777. !         -if [ ! -f $@ ]; then \
  778.               ./bootmhn.sh $(ETCDIR); \
  779. --- 280,282 ----
  780.   $(ETCDIR)/mhn_defaults:    true
  781. !         -@if [ ! -f $@ ]; then \
  782.               ./bootmhn.sh $(ETCDIR); \
  783. *** ../mh-6.8/conf/makefiles/uip    Tue Dec 15 08:53:14 1992
  784. --- conf/makefiles/uip    Fri Dec 18 09:57:59 1992
  785. ***************
  786. *** 4,6 ****
  787.   #    @(MHWARNING)
  788. ! # @(#)$Id: uip,v 2.38 1992/11/18 16:54:29 jromine Exp $
  789.   ##############################################################################
  790. --- 4,6 ----
  791.   #    @(MHWARNING)
  792. ! # @(#)$Id: uip,v 2.39 1992/12/18 17:57:45 jromine Exp $
  793.   ##############################################################################
  794. ***************
  795. *** 86,87 ****
  796. --- 86,88 ----
  797.   @END: KPOP
  798. + @END: POP
  799.   @BEGIN: BPOP
  800. ***************
  801. *** 94,96 ****
  802.   @END: NNTP
  803. - @END: POP
  804.   @BEGIN: HESIOD
  805. --- 95,96 ----
  806. *** ../mh-6.8/conf/makefiles/zotnet/mts    Tue Dec 15 08:53:15 1992
  807. --- conf/makefiles/zotnet/mts    Fri Aug 20 08:56:17 1993
  808. ***************
  809. *** 4,6 ****
  810.   #    @(MHWARNING)
  811. ! # @(#)$Id: mts,v 1.8 1992/02/06 17:29:00 jromine Exp $
  812.   ##############################################################################
  813. --- 4,6 ----
  814.   #    @(MHWARNING)
  815. ! # @(#)$Id: mts,v 1.9 1993/08/20 15:56:12 jromine Exp $
  816.   ##############################################################################
  817. ***************
  818. *** 94,96 ****
  819.   $(ETCDIR)/mtstailor:    mtstailor
  820. !         -if [ ! -f $@ ]; then \
  821.               $(REMOVE) $@ zmtstailor; \
  822. --- 94,96 ----
  823.   $(ETCDIR)/mtstailor:    mtstailor
  824. !         -@if [ ! -f $@ ]; then \
  825.               $(REMOVE) $@ zmtstailor; \
  826. *** ../mh-6.8/conf/makefiles/zotnet/tws    Tue Dec 15 08:53:15 1992
  827. --- conf/makefiles/zotnet/tws    Fri Feb 26 13:51:04 1993
  828. ***************
  829. *** 4,6 ****
  830.   #    @(MHWARNING)
  831. ! # @(#)$Id: tws,v 1.15 1992/11/18 16:54:16 jromine Exp $
  832.   ##############################################################################
  833. --- 4,6 ----
  834.   #    @(MHWARNING)
  835. ! # @(#)$Id: tws,v 1.16 1993/02/26 21:50:51 jromine Exp $
  836.   ##############################################################################
  837. ***************
  838. *** 73,74 ****
  839. --- 73,76 ----
  840.           $(LEX) dtimep.lex | sed -f lexedit.sed > dtimep.c
  841. +         len=`wc -l dtimep.c | awk ' { print $$1 } '`; \
  842. +             if [ $$len -eq 1 ]; then cp dtimep.c-lexed dtimep.c; fi
  843.   
  844. *** ../mh-6.8/h/fmtcompile.h    Tue Dec 15 08:53:20 1992
  845. --- h/fmtcompile.h    Fri Jun 11 23:46:32 1993
  846. ***************
  847. *** 1,4 ****
  848. ! /* @(#)$Id: fmtcompile.h,v 1.9 1992/02/09 07:12:48 jromine Exp $ */
  849.   
  850.   /* Format Types */
  851.   /* -------------*/
  852. --- 1,4 ----
  853. ! /* @(#)$Id: fmtcompile.h,v 1.10 1993/06/12 06:46:16 jromine Exp $ */
  854.   
  855.   /* Format Types */
  856.   /* -------------*/
  857. ***************
  858. *** 20,104 ****
  859.   #define FT_LS_COMP    12    /* set "str" to component text */
  860.   #define FT_LS_LIT    13    /* set "str" to literal text */
  861.   #define FT_LS_GETENV    14    /* set "str" to getenv(text) */
  862. ! #define FT_LS_TRIM    15    /* trim trailing white space from "str" */
  863. ! #define FT_LV_COMP    16    /* set "value" to comp (as dec. num) */
  864. ! #define FT_LV_COMPFLAG    17    /* set "value" to comp flag word */
  865. ! #define FT_LV_LIT    18    /* set "value" to literal num */
  866. ! #define FT_LV_DAT    19    /* set "value" to dat[n] */
  867. ! #define FT_LV_STRLEN    20    /* set "value" to length of "str" */
  868. ! #define FT_LV_PLUS_L    21    /* set "value" += literal */
  869. ! #define FT_LV_MINUS_L    22    /* set "value" -= literal */
  870. ! #define FT_LV_DIVIDE_L    23    /* set "value" to value / literal */
  871. ! #define    FT_LV_MODULO_L    24    /* set "value" to value % literal */
  872. ! #define FT_LV_CHAR_LEFT 25      /* set "value" to char left in output */
  873.   
  874. ! #define FT_LS_MONTH     26      /* set "str" to tws month */
  875. ! #define FT_LS_LMONTH    27      /* set "str" to long tws month */
  876. ! #define FT_LS_ZONE      28      /* set "str" to tws timezone */
  877. ! #define FT_LS_DAY       29      /* set "str" to tws weekday */
  878. ! #define FT_LS_WEEKDAY   30      /* set "str" to long tws weekday */
  879. ! #define FT_LS_822DATE   31      /* set "str" to 822 date str */
  880. ! #define FT_LS_PRETTY    32      /* set "str" to pretty (?) date str */
  881. ! #define FT_LV_SEC       33      /* set "value" to tws second */
  882. ! #define FT_LV_MIN       34      /* set "value" to tws minute */
  883. ! #define FT_LV_HOUR      35      /* set "value" to tws hour */
  884. ! #define FT_LV_MDAY      36      /* set "value" to tws day of month */
  885. ! #define FT_LV_MON       37      /* set "value" to tws month */
  886. ! #define FT_LV_YEAR      38      /* set "value" to tws year */
  887. ! #define FT_LV_YDAY      39      /* set "value" to tws day of year */
  888. ! #define FT_LV_WDAY      40      /* set "value" to tws weekday */
  889. ! #define FT_LV_ZONE      41      /* set "value" to tws timezone */
  890. ! #define FT_LV_CLOCK     42      /* set "value" to tws clock */
  891. ! #define FT_LV_RCLOCK    43      /* set "value" to now - tws clock */
  892. ! #define FT_LV_DAYF      44      /* set "value" to tws day flag */
  893. ! #define FT_LV_DST       45      /* set "value" to tws daylight savings flag */
  894. ! #define FT_LV_ZONEF     46      /* set "value" to tws timezone flag */
  895.   
  896. ! #define FT_LS_PERS      47      /* set "str" to person part of addr */
  897. ! #define FT_LS_MBOX      48      /* set "str" to mbox part of addr */
  898. ! #define FT_LS_HOST      49      /* set "str" to host part of addr */
  899. ! #define FT_LS_PATH      50      /* set "str" to route part of addr */
  900. ! #define FT_LS_GNAME     51      /* set "str" to group part of addr */
  901. ! #define FT_LS_NOTE      52      /* set "str" to comment part of addr */
  902. ! #define FT_LS_ADDR      53      /* set "str" to mbox@host */
  903. ! #define FT_LS_822ADDR   54      /* set "str" to 822 format addr */
  904. ! #define FT_LS_FRIENDLY  55      /* set "str" to "friendly" format addr */
  905. ! #define FT_LV_HOSTTYPE  56      /* set "value" to addr host type */
  906. ! #define FT_LV_INGRPF    57      /* set "value" to addr in-group flag */
  907. ! #define FT_LV_NOHOSTF   58      /* set "value" to addr no-host flag */
  908.   
  909.   /* Date Coercion */
  910. ! #define FT_LOCALDATE    59      /* Coerce date to local timezone */
  911. ! #define FT_GMTDATE      60      /* Coerce date to gmt */
  912.   
  913.   /* pre-format processing */
  914. ! #define FT_PARSEDATE    61      /* parse comp into a date (tws) struct */
  915. ! #define FT_PARSEADDR    62      /* parse comp into a mailaddr struct */
  916. ! #define FT_FORMATADDR   63      /* let external routine format addr */
  917. ! #define FT_MYMBOX       64      /* do "mymbox" test on comp */
  918.   
  919.   /* misc. */        /* ADDTOSEQ only works if you include "options LBL" */
  920. ! #define FT_ADDTOSEQ     65      /* add current msg to a sequence */
  921.   
  922.   /* conditionals & control flow (must be last) */
  923. ! #define FT_SAVESTR      66      /* save current str reg */
  924. ! #define FT_DONE         67      /* stop formatting */
  925. ! #define FT_PAUSE        68      /* pause */
  926. ! #define FT_NOP          69      /* nop */
  927. ! #define FT_GOTO         70      /* (relative) goto */
  928. ! #define FT_IF_S_NULL    71      /* test if "str" null */
  929. ! #define FT_IF_S         72      /* test if "str" non-null */
  930. ! #define FT_IF_V_EQ      73      /* test if "value" = literal */
  931. ! #define FT_IF_V_NE      74      /* test if "value" != literal */
  932. ! #define FT_IF_V_GT      75      /* test if "value" > literal */
  933. ! #define FT_IF_MATCH     76      /* test if "str" contains literal */
  934. ! #define FT_IF_AMATCH    77      /* test if "str" starts with literal */
  935. ! #define FT_S_NULL       78      /* V = 1 if "str" null */
  936. ! #define FT_S_NONNULL    79      /* V = 1 if "str" non-null */
  937. ! #define FT_V_EQ         80      /* V = 1 if "value" = literal */
  938. ! #define FT_V_NE         81      /* V = 1 if "value" != literal */
  939. ! #define FT_V_GT         82      /* V = 1 if "value" > literal */
  940. ! #define FT_V_MATCH      83      /* V = 1 if "str" contains literal */
  941. ! #define FT_V_AMATCH     84      /* V = 1 if "str" starts with literal */
  942.   
  943. ! #define IF_FUNCS FT_S_NULL      /* start of "if" functions */
  944. --- 20,105 ----
  945.   #define FT_LS_COMP    12    /* set "str" to component text */
  946.   #define FT_LS_LIT    13    /* set "str" to literal text */
  947.   #define FT_LS_GETENV    14    /* set "str" to getenv(text) */
  948. ! #define FT_LS_MFIND    15    /* set "str" to m_find(text) */
  949. ! #define FT_LS_TRIM    16    /* trim trailing white space from "str" */
  950. ! #define FT_LV_COMP    17    /* set "value" to comp (as dec. num) */
  951. ! #define FT_LV_COMPFLAG    18    /* set "value" to comp flag word */
  952. ! #define FT_LV_LIT    19    /* set "value" to literal num */
  953. ! #define FT_LV_DAT    20    /* set "value" to dat[n] */
  954. ! #define FT_LV_STRLEN    21    /* set "value" to length of "str" */
  955. ! #define FT_LV_PLUS_L    22    /* set "value" += literal */
  956. ! #define FT_LV_MINUS_L    23    /* set "value" -= literal */
  957. ! #define FT_LV_DIVIDE_L    24    /* set "value" to value / literal */
  958. ! #define FT_LV_MODULO_L    25    /* set "value" to value % literal */
  959. ! #define FT_LV_CHAR_LEFT 26    /* set "value" to char left in output */
  960.   
  961. ! #define FT_LS_MONTH    27    /* set "str" to tws month */
  962. ! #define FT_LS_LMONTH    28    /* set "str" to long tws month */
  963. ! #define FT_LS_ZONE    29    /* set "str" to tws timezone */
  964. ! #define FT_LS_DAY    30    /* set "str" to tws weekday */
  965. ! #define FT_LS_WEEKDAY    31    /* set "str" to long tws weekday */
  966. ! #define FT_LS_822DATE    32    /* set "str" to 822 date str */
  967. ! #define FT_LS_PRETTY    33    /* set "str" to pretty (?) date str */
  968. ! #define FT_LV_SEC    34    /* set "value" to tws second */
  969. ! #define FT_LV_MIN    35    /* set "value" to tws minute */
  970. ! #define FT_LV_HOUR    36    /* set "value" to tws hour */
  971. ! #define FT_LV_MDAY    37    /* set "value" to tws day of month */
  972. ! #define FT_LV_MON    38    /* set "value" to tws month */
  973. ! #define FT_LV_YEAR    39    /* set "value" to tws year */
  974. ! #define FT_LV_YDAY    40    /* set "value" to tws day of year */
  975. ! #define FT_LV_WDAY    41    /* set "value" to tws weekday */
  976. ! #define FT_LV_ZONE    42    /* set "value" to tws timezone */
  977. ! #define FT_LV_CLOCK    43    /* set "value" to tws clock */
  978. ! #define FT_LV_RCLOCK    44    /* set "value" to now - tws clock */
  979. ! #define FT_LV_DAYF    45    /* set "value" to tws day flag */
  980. ! #define FT_LV_DST    46    /* set "value" to tws daylight savings flag */
  981. ! #define FT_LV_ZONEF    47    /* set "value" to tws timezone flag */
  982.   
  983. ! #define FT_LS_PERS    48    /* set "str" to person part of addr */
  984. ! #define FT_LS_MBOX    49    /* set "str" to mbox part of addr */
  985. ! #define FT_LS_HOST    50    /* set "str" to host part of addr */
  986. ! #define FT_LS_PATH    51    /* set "str" to route part of addr */
  987. ! #define FT_LS_GNAME    52    /* set "str" to group part of addr */
  988. ! #define FT_LS_NOTE    53    /* set "str" to comment part of addr */
  989. ! #define FT_LS_ADDR    54    /* set "str" to mbox@host */
  990. ! #define FT_LS_822ADDR    55    /* set "str" to 822 format addr */
  991. ! #define FT_LS_FRIENDLY    56    /* set "str" to "friendly" format addr */
  992. ! #define FT_LV_HOSTTYPE    57    /* set "value" to addr host type */
  993. ! #define FT_LV_INGRPF    58    /* set "value" to addr in-group flag */
  994. ! #define FT_LV_NOHOSTF    59    /* set "value" to addr no-host flag */
  995.   
  996.   /* Date Coercion */
  997. ! #define FT_LOCALDATE    60    /* Coerce date to local timezone */
  998. ! #define FT_GMTDATE    61    /* Coerce date to gmt */
  999.   
  1000.   /* pre-format processing */
  1001. ! #define FT_PARSEDATE    62    /* parse comp into a date (tws) struct */
  1002. ! #define FT_PARSEADDR    63    /* parse comp into a mailaddr struct */
  1003. ! #define FT_FORMATADDR    64    /* let external routine format addr */
  1004. ! #define FT_MYMBOX    65    /* do "mymbox" test on comp */
  1005.   
  1006.   /* misc. */        /* ADDTOSEQ only works if you include "options LBL" */
  1007. ! #define FT_ADDTOSEQ    66    /* add current msg to a sequence */
  1008.   
  1009.   /* conditionals & control flow (must be last) */
  1010. ! #define FT_SAVESTR    67    /* save current str reg */
  1011. ! #define FT_DONE        68    /* stop formatting */
  1012. ! #define FT_PAUSE    69    /* pause */
  1013. ! #define FT_NOP        70    /* nop */
  1014. ! #define FT_GOTO        71    /* (relative) goto */
  1015. ! #define FT_IF_S_NULL    72    /* test if "str" null */
  1016. ! #define FT_IF_S        73    /* test if "str" non-null */
  1017. ! #define FT_IF_V_EQ    74    /* test if "value" = literal */
  1018. ! #define FT_IF_V_NE    75    /* test if "value" != literal */
  1019. ! #define FT_IF_V_GT    76    /* test if "value" > literal */
  1020. ! #define FT_IF_MATCH    77    /* test if "str" contains literal */
  1021. ! #define FT_IF_AMATCH    78    /* test if "str" starts with literal */
  1022. ! #define FT_S_NULL    79    /* V = 1 if "str" null */
  1023. ! #define FT_S_NONNULL    80    /* V = 1 if "str" non-null */
  1024. ! #define FT_V_EQ        81    /* V = 1 if "value" = literal */
  1025. ! #define FT_V_NE        82    /* V = 1 if "value" != literal */
  1026. ! #define FT_V_GT        83    /* V = 1 if "value" > literal */
  1027. ! #define FT_V_MATCH    84    /* V = 1 if "str" contains literal */
  1028. ! #define FT_V_AMATCH    85    /* V = 1 if "str" starts with literal */
  1029.   
  1030. ! #define IF_FUNCS FT_S_NULL    /* start of "if" functions */
  1031. *** ../mh-6.8/h/mh.h    Tue Dec 15 08:53:21 1992
  1032. --- h/mh.h    Fri Feb 26 13:53:33 1993
  1033. ***************
  1034. *** 1,5 ****
  1035.   /* mh.h - main header file for all of MH */
  1036. ! /* @(#)$Id: mh.h,v 2.18 1992/12/14 17:10:43 jromine Exp $ */
  1037.   
  1038.   
  1039.   /* Well-used constants */
  1040. --- 1,5 ----
  1041.   /* mh.h - main header file for all of MH */
  1042. ! /* @(#)$Id: mh.h,v 2.19 1993/02/26 21:53:29 jromine Exp $ */
  1043.   
  1044.   
  1045.   /* Well-used constants */
  1046. ***************
  1047. *** 332,338 ****
  1048.   
  1049.   /* should be in <stdio.h> */
  1050.   
  1051. ! #if    !defined(SYS5) && !defined(ncr) && !defined(_AIX) && !defined(OSF1) && !defined(__convex__)
  1052.   typedef struct _iobuf  *FP;
  1053.   FP   popen ();
  1054.   #else /* SYS5 */
  1055. --- 332,338 ----
  1056.   
  1057.   /* should be in <stdio.h> */
  1058.   
  1059. ! #if    !defined(SYS5) && !defined(ncr) && !defined(_AIX) && !defined(OSF1) && !defined(__convex__) && !defined(__386BSD__) && !defined(BSD44)
  1060.   typedef struct _iobuf  *FP;
  1061.   FP   popen ();
  1062.   #else /* SYS5 */
  1063. *** ../mh-6.8/h/mhn.h    Tue Dec 15 08:53:22 1992
  1064. --- h/mhn.h    Fri Aug 20 08:43:47 1993
  1065. ***************
  1066. *** 1,5 ****
  1067.   /* mhn.h - definitions for mhn & friends */
  1068. ! /* @(#)$Id: mhn.h,v 1.2 1992/10/16 17:13:19 jromine Exp $ */
  1069.   
  1070.   #define    VRSN_FIELD    "MIME-Version"
  1071.   #define    VRSN_VALUE    "1.0"
  1072. --- 1,5 ----
  1073.   /* mhn.h - definitions for mhn & friends */
  1074. ! /* @(#)$Id: mhn.h,v 1.3 1993/08/20 15:43:43 jromine Exp $ */
  1075.   
  1076.   #define    VRSN_FIELD    "MIME-Version"
  1077.   #define    VRSN_VALUE    "1.0"
  1078. ***************
  1079. *** 13,18 ****
  1080. --- 13,20 ----
  1081.   #define    ID_FIELD    "Content-ID"
  1082.   
  1083.   #define    DESCR_FIELD    "Content-Description"
  1084. + #define    MD5_FIELD    "Content-MD5"
  1085.   
  1086.   
  1087.   #define    isatom(c) \
  1088. *** ../mh-6.8/h/strings.h    Tue Dec 15 08:53:23 1992
  1089. --- h/strings.h    Fri Feb 26 13:54:05 1993
  1090. ***************
  1091. *** 1,5 ****
  1092.   /* strings.h - define standard string functions */
  1093. ! /* @(#)$Id: strings.h,v 1.18 1992/11/12 19:34:05 jromine Exp $ */
  1094.   
  1095.   #ifndef    _STRINGS        /* once-only... */
  1096.   #define    _STRINGS
  1097. --- 1,5 ----
  1098.   /* strings.h - define standard string functions */
  1099. ! /* @(#)$Id: strings.h,v 1.19 1993/02/26 21:54:00 jromine Exp $ */
  1100.   
  1101.   #ifndef    _STRINGS        /* once-only... */
  1102.   #define    _STRINGS
  1103. ***************
  1104. *** 25,31 ****
  1105.   #endif /* SYS5 */
  1106.   
  1107.   #if    defined(BSD42) || defined(SVR4)
  1108. ! #ifndef    SVR4
  1109.   #include <strings.h>
  1110.   #else
  1111.   #include <string.h>
  1112. --- 25,31 ----
  1113.   #endif /* SYS5 */
  1114.   
  1115.   #if    defined(BSD42) || defined(SVR4)
  1116. ! #if !defined(SVR4) && !defined(__386BSD__) && !defined(BSD44)
  1117.   #include <strings.h>
  1118.   #else
  1119.   #include <string.h>
  1120. ***************
  1121. *** 51,57 ****
  1122.   char   *strncpy ();
  1123.   #endif
  1124.   
  1125. ! #ifndef    SVR4
  1126.   char   *getenv ();
  1127.   char   *calloc (), *malloc (), *realloc ();
  1128.   #endif    /* SVR4 */
  1129. --- 51,57 ----
  1130.   char   *strncpy ();
  1131.   #endif
  1132.   
  1133. ! #if !defined(SVR4) && !defined(__386BSD__) && !defined(BSD44)
  1134.   char   *getenv ();
  1135.   char   *calloc (), *malloc (), *realloc ();
  1136.   #endif    /* SVR4 */
  1137. *** ../mh-6.8/mts/sendmail/smail.c    Tue Dec 15 08:54:27 1992
  1138. --- mts/sendmail/smail.c    Fri Aug 20 09:14:35 1993
  1139. ***************
  1140. *** 1,6 ****
  1141.   /* smail.c - MH interface to SendMail/SMTP */
  1142.   #ifndef    lint
  1143. ! static char ident[] = "@(#)$Id: smail.c,v 1.21 1992/11/09 18:19:32 jromine Exp $";
  1144.   #endif
  1145.   
  1146.   /* LINTLIBRARY */
  1147. --- 1,6 ----
  1148.   /* smail.c - MH interface to SendMail/SMTP */
  1149.   #ifndef    lint
  1150. ! static char ident[] = "@(#)$Id: smail.c,v 1.24 1993/08/20 16:14:30 jromine Exp $";
  1151.   #endif
  1152.   
  1153.   /* LINTLIBRARY */
  1154. ***************
  1155. *** 118,123 ****
  1156. --- 118,131 ----
  1157.   extern    char  **brkstring (), **copyip (), *getcpy ();
  1158.   #endif
  1159.   
  1160. + static    int    doingEHLO;
  1161. + #define    MAXEHLO    10
  1162. + char   *EHLOkeys[MAXEHLO + 1];
  1163. + char   *EHLOset ();
  1164.   /*   */
  1165.   
  1166.   #ifndef    SMTP
  1167. ***************
  1168. *** 124,135 ****
  1169.   
  1170.   /* ARGSUSED */
  1171.   
  1172. ! int     sm_init (client, server, watch, verbose, debug)
  1173. ! register char   *client;
  1174. ! char   *server;
  1175. ! register int     watch,
  1176. !               verbose,
  1177. !          debug;
  1178.   {
  1179.       register int    i,
  1180.                       result,
  1181. --- 132,145 ----
  1182.   
  1183.   /* ARGSUSED */
  1184.   
  1185. ! int     sm_init (client, server, watch, verbose, debug, onex, queued)
  1186. ! char   *client,
  1187. !        *server;
  1188. ! int    watch,
  1189. !     verbose,
  1190. !     debug,
  1191. !     onex,
  1192. !         queued;
  1193.   {
  1194.       register int    i,
  1195.                       result,
  1196. ***************
  1197. *** 148,153 ****
  1198. --- 158,164 ----
  1199.       sm_debug = debug;
  1200.       if (sm_rfp != NULL && sm_wfp != NULL)
  1201.       return RP_OK;
  1202.   #ifdef ZMAILER
  1203.       if (client == NULL || *client == '\0')
  1204.       client = "localhost";
  1205. ***************
  1206. *** 185,191 ****
  1207.           vec[vecp++] = r1bindex (sendmail, '/');
  1208.           vec[vecp++] = "-bs";
  1209.   #ifndef ZMAILER
  1210. !         vec[vecp++] = watch ? "-odi" : "-odb";
  1211.           vec[vecp++] = "-oem";
  1212.           vec[vecp++] = "-om";
  1213.   #ifndef    RAND
  1214. --- 196,202 ----
  1215.           vec[vecp++] = r1bindex (sendmail, '/');
  1216.           vec[vecp++] = "-bs";
  1217.   #ifndef ZMAILER
  1218. !         vec[vecp++] = watch ? "-odi" : queued ? "-odq" : "-odb";
  1219.           vec[vecp++] = "-oem";
  1220.           vec[vecp++] = "-om";
  1221.   #ifndef    RAND
  1222. ***************
  1223. *** 227,246 ****
  1224.               (void) sm_end (NOTOK);
  1225.               return RP_RPLY;
  1226.           }
  1227. - #ifndef ZMAILER
  1228. -         (void) smtalk(SM_HELO, "ONEX");
  1229. - #endif /* not ZMAILER */
  1230. -         if (watch)
  1231. -         (void) smtalk(SM_HELO, "VERB on");
  1232. -         if (client && *client)
  1233. -         switch (smtalk (SM_HELO, "HELO %s", client)) {
  1234. -             case 250: 
  1235. -             break;
  1236.   
  1237. !             default: 
  1238.               (void) sm_end (NOTOK);
  1239.               return RP_RPLY;
  1240.           }
  1241.           return RP_OK;
  1242.       }
  1243.   }
  1244. --- 238,269 ----
  1245.               (void) sm_end (NOTOK);
  1246.               return RP_RPLY;
  1247.           }
  1248.   
  1249. !         if (client && *client) {
  1250. !         doingEHLO = 1;
  1251. !         result = smtalk (SM_HELO, "EHLO %s", client);
  1252. !         doingEHLO = 0;
  1253. !         if (500 <= result && result <= 599)
  1254. !             result = smtalk (SM_HELO, "HELO %s", client);
  1255. !         switch (result) {
  1256. !             case 250:
  1257. !                 break;
  1258. !             default:
  1259.               (void) sm_end (NOTOK);
  1260.               return RP_RPLY;
  1261.           }
  1262. +         }
  1263. + #ifndef    ZMAILER
  1264. +         if (onex)
  1265. +         (void) smtalk (SM_HELO, "ONEX");
  1266. + #endif
  1267. +         if (watch)
  1268. +         (void) smtalk (SM_HELO, "VERB on");
  1269.           return RP_OK;
  1270.       }
  1271.   }
  1272. ***************
  1273. *** 248,259 ****
  1274.   
  1275.   /*   */
  1276.   
  1277. ! int     sm_init (client, server, watch, verbose, debug)
  1278. ! register char   *client,
  1279. !             *server;
  1280. ! register int     watch,
  1281. !                verbose,
  1282. !          debug;
  1283.   {
  1284.       register int    result,
  1285.                       sd1,
  1286. --- 271,284 ----
  1287.   
  1288.   /*   */
  1289.   
  1290. ! int     sm_init (client, server, watch, verbose, debug, onex, queued)
  1291. ! char   *client,
  1292. !        *server;
  1293. ! int    watch,
  1294. !     verbose,
  1295. !     debug,
  1296. !     onex,
  1297. !     queued;
  1298.   {
  1299.       register int    result,
  1300.                       sd1,
  1301. ***************
  1302. *** 260,274 ****
  1303.                       sd2;
  1304.   
  1305.       if (watch)
  1306. ! #if defined(SUN40) && !defined(MMDFII)
  1307. !     debug = verbose = TRUE;
  1308. ! #else
  1309.       verbose = TRUE;
  1310.   #endif
  1311.       sm_verbose = verbose;
  1312.       sm_debug = debug;
  1313.       if (sm_rfp != NULL && sm_wfp != NULL)
  1314. !     return RP_OK;
  1315.   #ifdef ZMAILER
  1316.       if (client == NULL || *client == '\0')
  1317.       client = "localhost";
  1318. --- 285,304 ----
  1319.                       sd2;
  1320.   
  1321.       if (watch)
  1322. ! #if    !defined(SUN40) || defined(MMDFII)
  1323.       verbose = TRUE;
  1324. + #else    /* to show the transaction, -watch must imply -snoop */
  1325. +     debug = verbose = TRUE;
  1326.   #endif
  1327.       sm_verbose = verbose;
  1328.       sm_debug = debug;
  1329. + #ifdef    MPOP
  1330. +     if (sm_ispool)
  1331. +     goto all_done;
  1332. + #endif
  1333.       if (sm_rfp != NULL && sm_wfp != NULL)
  1334. !     goto send_options;
  1335.   #ifdef ZMAILER
  1336.       if (client == NULL || *client == '\0')
  1337.       client = "localhost";
  1338. ***************
  1339. *** 277,288 ****
  1340.       if (client == NULL || *client == 0)
  1341.       client = LocalName ();
  1342.   #endif
  1343. ! #endif    /* ZMAILER */
  1344.   
  1345. - #ifdef    MPOP
  1346. -     if (sm_ispool)
  1347. -     goto all_done;
  1348. - #endif
  1349.       if ((sd1 = rclient (server, "tcp", "smtp")) == NOTOK)
  1350.       return RP_BHST;
  1351.   #ifdef    MPOP
  1352. --- 307,314 ----
  1353.       if (client == NULL || *client == 0)
  1354.       client = LocalName ();
  1355.   #endif
  1356. ! #endif    /* not ZMAILER */
  1357.   
  1358.       if ((sd1 = rclient (server, "tcp", "smtp")) == NOTOK)
  1359.       return RP_BHST;
  1360.   #ifdef    MPOP
  1361. ***************
  1362. *** 330,344 ****
  1363.           (void) sm_end (NOTOK);
  1364.           return RP_RPLY;
  1365.       }
  1366. ! #if    !(defined(ZMAILER) || defined(MMDFII))
  1367. !     (void) smtalk(SM_HELO, "ONEX");
  1368. ! #endif /* not ZMAILER */
  1369. ! #ifndef    MMDFII
  1370. !     if (watch)
  1371. !     (void) smtalk(SM_HELO, "VERB on");
  1372. ! #endif
  1373. !     if (client && *client)
  1374. !     switch (smtalk (SM_HELO, "HELO %s", client)) {
  1375.           case 250: 
  1376.           break;
  1377.   
  1378. --- 356,371 ----
  1379.           (void) sm_end (NOTOK);
  1380.           return RP_RPLY;
  1381.       }
  1382. !     if (client && *client) {
  1383. !     doingEHLO = 1;
  1384. !     result = smtalk (SM_HELO, "EHLO %s", client);
  1385. !     doingEHLO = 0;
  1386. !     if (500 <= result && result <= 599)
  1387. !         result = smtalk (SM_HELO, "HELO %s", client);
  1388. !     switch (result) {
  1389.           case 250: 
  1390.           break;
  1391.   
  1392. ***************
  1393. *** 346,352 ****
  1394. --- 373,388 ----
  1395.           (void) sm_end (NOTOK);
  1396.           return RP_RPLY;
  1397.       }
  1398. +     }
  1399.   
  1400. + send_options: ;
  1401. +     if (watch && EHLOset ("XVRB"))
  1402. +     (void) smtalk (SM_HELO, "VERB on");
  1403. +     if (onex && EHLOset ("XONE"))
  1404. +     (void) smtalk (SM_HELO, "ONEX");
  1405. +     if (queued && EHLOset ("XQUE"))
  1406. +     (void) smtalk (SM_HELO, "QUED");
  1407.       return RP_OK;
  1408.   }
  1409.   
  1410. ***************
  1411. *** 1201,1208 ****
  1412.       int     bc;
  1413.       register char  *bp,
  1414.                      *rp;
  1415. !     char    buffer[BUFSIZ];
  1416.   
  1417.   again: ;
  1418.   
  1419.       sm_reply.text[sm_reply.length = 0] = 0;
  1420. --- 1237,1260 ----
  1421.       int     bc;
  1422.       register char  *bp,
  1423.                      *rp;
  1424. !     char  **ehlo,
  1425. !         buffer[BUFSIZ];
  1426.   
  1427. +     if (doingEHLO) {
  1428. +     static    int    at_least_once = 0;
  1429. +     if (at_least_once) {
  1430. +         char   *ep;
  1431. +         for (ehlo = EHLOkeys; ep = *ehlo; ehlo++)
  1432. +         free (ep);
  1433. +     }
  1434. +     else
  1435. +         at_least_once = 1;
  1436. +     *(ehlo = EHLOkeys) = NULL;
  1437. +     }
  1438.   again: ;
  1439.   
  1440.       sm_reply.text[sm_reply.length = 0] = 0;
  1441. ***************
  1442. *** 1214,1219 ****
  1443. --- 1266,1291 ----
  1444.           (void) fflush (stdout);
  1445.       }
  1446.   
  1447. +     if (doingEHLO
  1448. +             && strncmp (buffer, "250", sizeof "250" - 1) == 0
  1449. +             && (buffer[3] == '-' || doingEHLO == 2)
  1450. +             && buffer[4]) {
  1451. +         if (doingEHLO == 2) {
  1452. +         int    len = strlen (buffer + 4);
  1453. +         if (*ehlo = malloc ((unsigned) (strlen (buffer + 4) + 1))) {
  1454. +             (void) strcpy (*ehlo++, buffer + 4);
  1455. +             *ehlo = NULL;
  1456. +             if (ehlo >= EHLOkeys + MAXEHLO)
  1457. +             doingEHLO = 0;
  1458. +         }
  1459. +         else
  1460. +             doingEHLO = 0;
  1461. +         }
  1462. +         else
  1463. +         doingEHLO = 2;
  1464. +     }
  1465.       for (; bc > 0 && (!isascii (*bp) || !isdigit (*bp)); bp++, bc--)
  1466.           continue;
  1467.   
  1468. ***************
  1469. *** 1261,1266 ****
  1470. --- 1333,1339 ----
  1471.       }
  1472.   
  1473.       sm_reply.length = rp - sm_reply.text;
  1474.       return sm_reply.code;
  1475.       }
  1476.   
  1477. ***************
  1478. *** 1445,1447 ****
  1479. --- 1518,1539 ----
  1480.   }
  1481.   #endif
  1482.   #endif /* MPOP */
  1483. + /*   */
  1484. + char *EHLOset (s)
  1485. + char *s;
  1486. + {
  1487. +     int        len = strlen (s);
  1488. +     register char  *ep,
  1489. +          **ehlo;
  1490. +     for (ehlo = EHLOkeys; ep = *ehlo; ehlo++)
  1491. +     if (strncmp (ep, s, len) == 0) {
  1492. +         for (ep += len; *ep == ' '; ep++)
  1493. +         continue;
  1494. +         return ep;
  1495. +     }
  1496. +     return 0;
  1497. + }
  1498. *** ../mh-6.8/sbr/discard.c    Tue Dec 15 08:55:13 1992
  1499. --- sbr/discard.c    Fri Feb 26 13:56:13 1993
  1500. ***************
  1501. *** 1,10 ****
  1502.   /* discard.c - discard output on a file pointer */
  1503.   #ifndef    lint
  1504. ! static char ident[] = "@(#)$Id: discard.c,v 1.6 1992/12/15 00:20:22 jromine Exp $";
  1505.   #endif    /* lint */
  1506.   
  1507.   #include "../h/mh.h"
  1508.   #include <stdio.h>
  1509.   #ifndef    SYS5
  1510.   #include <sgtty.h>
  1511.   #else    /* SYS5 */
  1512. --- 1,13 ----
  1513.   /* discard.c - discard output on a file pointer */
  1514.   #ifndef    lint
  1515. ! static char ident[] = "@(#)$Id: discard.c,v 1.7 1993/02/26 21:56:04 jromine Exp $";
  1516.   #endif    /* lint */
  1517.   
  1518.   #include "../h/mh.h"
  1519.   #include <stdio.h>
  1520. + #ifdef POSIX
  1521. + #include <termios.h>
  1522. + #else
  1523.   #ifndef    SYS5
  1524.   #include <sgtty.h>
  1525.   #else    /* SYS5 */
  1526. ***************
  1527. *** 14,33 ****
  1528. --- 17,42 ----
  1529.   #include <sys/ioctl.h>
  1530.   #endif    /* NOIOCTLH */
  1531.   #endif    /* SYS5 */
  1532. + #endif    /* POSIX */
  1533.   
  1534.   
  1535.   void    discard (io)
  1536.   FILE   *io;
  1537.   {
  1538. + #ifndef POSIX
  1539.   #ifndef    SYS5
  1540.       struct sgttyb   sg;
  1541.   #else    /* SYS5 */
  1542.       struct termio   sg;
  1543.   #endif    /* SYS5 */
  1544. + #endif    /* POSIX */
  1545.   
  1546.       if (io == NULL)
  1547.       return;
  1548.   
  1549. + #ifdef POSIX
  1550. +     tcflush (fileno (io), TCOFLUSH);
  1551. + #else
  1552.   #ifndef    SYS5
  1553.       if (ioctl (fileno (io), TIOCGETP, (char *) &sg) != NOTOK)
  1554.       (void) ioctl (fileno (io), TIOCSETP, (char *) &sg);
  1555. ***************
  1556. *** 35,41 ****
  1557. --- 44,55 ----
  1558.       if (ioctl (fileno (io), TCGETA, &sg) != NOTOK)
  1559.       (void) ioctl (fileno (io), TCSETA, &sg);
  1560.   #endif    /* SYS5 */
  1561. + #endif    /* POSIX */
  1562.   
  1563. + #ifdef _FSTDIO
  1564. +     fpurge (io);
  1565. + #else
  1566.       if (io -> _ptr = io -> _base)
  1567.       io -> _cnt = 0;
  1568. + #endif
  1569.   }
  1570. *** ../mh-6.8/sbr/fmtcompile.c    Tue Dec 15 08:55:13 1992
  1571. --- sbr/fmtcompile.c    Thu Aug 19 14:05:48 1993
  1572. ***************
  1573. *** 1,6 ****
  1574.   /* fmtcompile.c - "compile" format strings for fmtscan */
  1575.   #ifndef    lint
  1576. ! static char ident[] = "@(#)$Id: fmtcompile.c,v 1.15 1992/12/15 00:20:22 jromine Exp $";
  1577.   #endif    /* lint */
  1578.   
  1579.   #include "../h/mh.h"
  1580. --- 1,6 ----
  1581.   /* fmtcompile.c - "compile" format strings for fmtscan */
  1582.   #ifndef    lint
  1583. ! static char ident[] = "@(#)$Id: fmtcompile.c,v 1.17 1993/08/19 21:05:42 jromine Exp $";
  1584.   #endif    /* lint */
  1585.   
  1586.   #include "../h/mh.h"
  1587. ***************
  1588. *** 64,69 ****
  1589. --- 64,70 ----
  1590.       "comp",    TF_COMP,    FT_LS_COMP,    0,        TFL_PUTS,
  1591.       "lit",    TF_STR,        FT_LS_LIT,    0,        TFL_PUTS,
  1592.       "getenv",    TF_STR,        FT_LS_GETENV,    0,        TFL_PUTS,
  1593. +     "profile",    TF_STR,        FT_LS_MFIND,    0,        TFL_PUTS,
  1594.       "trim",    TF_EXPR,    FT_LS_TRIM,    0,        0,
  1595.       "compval",    TF_COMP,    FT_LV_COMP,    0,        TFL_PUTN,
  1596.       "compflag",    TF_COMP,    FT_LV_COMPFLAG,    0,        TFL_PUTN,
  1597. ***************
  1598. *** 371,377 ****
  1599.       register int i;
  1600.       static int primed = 0;
  1601.   
  1602. !     while (isalnum(c = *cp++) || c == '-') 
  1603.       ;
  1604.       if (c != '}') {
  1605.       CERROR("'}' expected");
  1606. --- 372,378 ----
  1607.       register int i;
  1608.       static int primed = 0;
  1609.   
  1610. !     while (isalnum(c = *cp++) || c == '-' || c == '_')
  1611.       ;
  1612.       if (c != '}') {
  1613.       CERROR("'}' expected");
  1614. *** ../mh-6.8/sbr/formatsbr.c    Tue Dec 15 08:55:14 1992
  1615. --- sbr/formatsbr.c    Fri Aug 20 08:48:29 1993
  1616. ***************
  1617. *** 1,6 ****
  1618.   /* formatsbr.c - format string interpretation */
  1619.   #ifndef    lint
  1620. ! static char ident[] = "@(#)$Id: formatsbr.c,v 1.21 1992/12/15 00:20:22 jromine Exp $";
  1621.   #endif    /* lint */
  1622.   
  1623.   #include "../h/mh.h"
  1624. --- 1,6 ----
  1625.   /* formatsbr.c - format string interpretation */
  1626.   #ifndef    lint
  1627. ! static char ident[] = "@(#)$Id: formatsbr.c,v 1.24 1993/08/20 15:48:14 jromine Exp $";
  1628.   #endif    /* lint */
  1629.   
  1630.   #include "../h/mh.h"
  1631. ***************
  1632. *** 59,65 ****
  1633.       if ((formats = malloc ((unsigned) st.st_size + 1)) == NULLCP)
  1634.           adios (form, "unable to allocate space for format");
  1635.   
  1636. !     if (read (fileno(fp), formats, st.st_size) != st.st_size)
  1637.           adios (form, "error reading format file");
  1638.   
  1639.       formats[st.st_size] = '\0';
  1640. --- 59,65 ----
  1641.       if ((formats = malloc ((unsigned) st.st_size + 1)) == NULLCP)
  1642.           adios (form, "unable to allocate space for format");
  1643.   
  1644. !     if (read (fileno(fp), formats, (int) st.st_size) != st.st_size)
  1645.           adios (form, "error reading format file");
  1646.   
  1647.       formats[st.st_size] = '\0';
  1648. ***************
  1649. *** 304,310 ****
  1650.   
  1651.       if (get_x400_comp (mbox, "/PN=", buffer)) {
  1652.       for (mbox = buffer; mbox = index (mbox, '.'); )
  1653. !         *mbox++ = 0;
  1654.   
  1655.       return buffer;
  1656.       }
  1657. --- 304,310 ----
  1658.   
  1659.       if (get_x400_comp (mbox, "/PN=", buffer)) {
  1660.       for (mbox = buffer; mbox = index (mbox, '.'); )
  1661. !         *mbox++ = ' ';
  1662.   
  1663.       return buffer;
  1664.       }
  1665. ***************
  1666. *** 506,511 ****
  1667. --- 506,515 ----
  1668.           break;
  1669.       case FT_LS_GETENV:
  1670.           if (!(str = getenv (fmt->f_text)))
  1671. +         str = "";
  1672. +         break;
  1673. +     case FT_LS_MFIND:
  1674. +         if (!(str = m_find (fmt->f_text)))
  1675.           str = "";
  1676.           break;
  1677.       case FT_LS_TRIM:
  1678. *** ../mh-6.8/sbr/m_getfld.c    Tue Dec 15 08:55:18 1992
  1679. --- sbr/m_getfld.c    Fri Feb 26 13:57:19 1993
  1680. ***************
  1681. *** 1,6 ****
  1682.   /* m_getfld.c - read/parse a message */
  1683.   #ifndef    lint
  1684. ! static char ident[] = "@(#)$Id: m_getfld.c,v 1.14 1992/10/31 07:44:56 jromine Exp $";
  1685.   #endif /* lint */
  1686.   
  1687.   #include "../h/mh.h"
  1688. --- 1,6 ----
  1689.   /* m_getfld.c - read/parse a message */
  1690.   #ifndef    lint
  1691. ! static char ident[] = "@(#)$Id: m_getfld.c,v 1.15 1993/02/26 21:57:14 jromine Exp $";
  1692.   #endif /* lint */
  1693.   
  1694.   #include "../h/mh.h"
  1695. ***************
  1696. *** 170,175 ****
  1697. --- 170,181 ----
  1698.   static int  edelimlen;
  1699.   
  1700.   static int  (*eom_action) () = NULL;
  1701. + #ifdef _FSTDIO
  1702. + #define    _ptr    _p        /* Gag */
  1703. + #define    _cnt    _r        /* Retch */
  1704. + #define    _filbuf    __srget        /* Puke */
  1705. + #endif
  1706.   
  1707.   /*   */
  1708.   
  1709. *** ../mh-6.8/sbr/pidstatus.c    Tue Dec 15 08:55:23 1992
  1710. --- sbr/pidstatus.c    Fri Feb 26 13:57:37 1993
  1711. ***************
  1712. *** 1,6 ****
  1713.   /* pidstatus.c - report child's status */
  1714.   #ifndef    lint
  1715. ! static char ident[] = "@(#)$Id: pidstatus.c,v 1.3 1992/12/15 00:20:22 jromine Exp $";
  1716.   #endif    /* lint */
  1717.   
  1718.   #include "../h/mh.h"
  1719. --- 1,6 ----
  1720.   /* pidstatus.c - report child's status */
  1721.   #ifndef    lint
  1722. ! static char ident[] = "@(#)$Id: pidstatus.c,v 1.4 1993/02/26 21:57:34 jromine Exp $";
  1723.   #endif    /* lint */
  1724.   
  1725.   #include "../h/mh.h"
  1726. ***************
  1727. *** 8,13 ****
  1728. --- 8,14 ----
  1729.   #include <stdio.h>
  1730.   
  1731.   
  1732. + #ifndef    BSD44
  1733.   #ifndef    BSD42
  1734.   static char *sigs[] = {
  1735.       NULL,
  1736. ***************
  1737. *** 45,50 ****
  1738. --- 46,52 ----
  1739.   #else
  1740.   extern  char *sys_siglist[];
  1741.   #endif    /* BSD42 */
  1742. + #endif    /* BSD44 defines sys_siglist in signal.h */
  1743.   
  1744.   /*   */
  1745.   
  1746. *** ../mh-6.8/support/general/bootmhn.sh    Tue Dec 15 08:55:37 1992
  1747. --- support/general/bootmhn.sh    Fri Aug 20 08:49:03 1993
  1748. ***************
  1749. *** 18,19 ****
  1750. --- 18,21 ----
  1751.   echo "mhn-store-text: %m%P.txt" >> $TMP
  1752. + echo "mhn-store-text/richtext: %m%P.rt" >> $TMP
  1753. + echo "mhn-store-video/mpeg: %m%P.mpg" >> $TMP
  1754.   echo "mhn-store-application/PostScript: %m%P.ps" >> $TMP
  1755. ***************
  1756. *** 68,72 ****
  1757.   mhn-store-audio/x-next: %m%P.au" >> $TMP
  1758.       echo "\
  1759. ! mhn-compose-audio/basic: ${AUDIODIR}record | ${AUDIODIR}raw2audio -F
  1760. ! mhn-show-audio/basic: %p${AUDIODIR}raw2audio 2>/dev/null | play" >> $TMP
  1761.   
  1762. --- 70,81 ----
  1763.   mhn-store-audio/x-next: %m%P.au" >> $TMP
  1764. +     AUDIOTOOL="`./bootmhn.findit audiotool $LIB`"
  1765. +     if [ ! -z "$AUDIOTOOL" ]; then
  1766. +         echo "\
  1767. + mhn-compose-audio/basic: $AUDIOTOOL %f && ${AUDIODIR}raw2audio -F < %f" >> $TMP
  1768. +     else
  1769. +         echo "\
  1770. + mhn-compose-audio/basic: trap \"exit 0\" 2 && ${AUDIODIR}record | ${AUDIODIR}raw2audio -F" >> $TMP
  1771. +     fi
  1772.       echo "\
  1773. ! mhn-show-audio/basic: %p${AUDIODIR}raw2audio 2>/dev/null | ${AUDIODIR}play" >> $TMP
  1774.   
  1775. ***************
  1776. *** 75,78 ****
  1777.           DIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
  1778.           echo "\
  1779. - mhn-compose-audio/x-next: ${AUDIODIR}record | ${DIR}adpcm_enc
  1780.   mhn-show-audio/x-next: %p${DIR}adpcm_dec | ${AUDIODIR}play" >> $TMP
  1781. --- 84,93 ----
  1782.           DIR="`echo $PGM | awk -F/ '{ for(i=2;i<NF;i++)printf "/%s", $i;}'`"/
  1783. +         if [ ! -z "$AUDIOTOOL" ]; then
  1784. +         echo "\
  1785. + mhn-compose-audio/x-next: $AUDIOTOOL %f && ${DIR}adpcm_enc < %f" >> $TMP
  1786. +         else
  1787. +         echo "\
  1788. + mhn-compose-audio/x-next: ${AUDIODIR}record | ${DIR}adpcm_enc" >> $TMP
  1789. +         fi
  1790.           echo "\
  1791.   mhn-show-audio/x-next: %p${DIR}adpcm_dec | ${AUDIODIR}play" >> $TMP
  1792. ***************
  1793. *** 79,82 ****
  1794.       else
  1795.           echo "\
  1796. - mhn-compose-audio/x-next: ${AUDIODIR}record
  1797.   mhn-show-audio/x-next: %p${AUDIODIR}play" >> $TMP
  1798. --- 94,103 ----
  1799.       else
  1800. +         if [ ! -z "$AUDIOTOOL" ]; then
  1801. +         echo "\
  1802. + mhn-compose-audio/x-next: $AUDIOTOOL %f" >> $TMP
  1803. +         else
  1804. +         echo "\
  1805. + mhn-compose-audio/x-next: ${AUDIODIR}record" >> $TMP
  1806. +         fi
  1807.           echo "\
  1808.   mhn-show-audio/x-next: %p${AUDIODIR}play" >> $TMP
  1809. ***************
  1810. *** 88,89 ****
  1811. --- 109,116 ----
  1812.       fi
  1813. + fi
  1814. + PGM="`./bootmhn.findit mpeg_play $LIB`"
  1815. + if [ ! -z "$PGM" ]; then
  1816. +     echo "\
  1817. + mhn-show-video/mpeg: %p$PGM '%f'" >> $TMP
  1818.   fi
  1819. *** ../mh-6.8/support/general/viamail.sh    Tue Dec 15 08:55:40 1992
  1820. --- support/general/viamail.sh    Fri Aug 20 08:49:21 1993
  1821. ***************
  1822. *** 1,3 ****
  1823.   : run this script through /bin/sh
  1824. ! : '@(#)$Id: viamail.sh,v 1.2 1992/10/16 17:15:00 jromine Exp $'
  1825.   
  1826. --- 1,3 ----
  1827.   : run this script through /bin/sh
  1828. ! : '@(#)$Id: viamail.sh,v 1.4 1993/08/20 15:49:19 jromine Exp $'
  1829.   
  1830. ***************
  1831. *** 28,32 ****
  1832.   
  1833. ! tar cvf - $* | compress | \
  1834.       mhn -viamail "$mailpath" -viasubj "$subject" \
  1835. !     -viaparm "type=tar; conversions=x-compress" \
  1836.       -viacmnt "extract with uncompress | tar xvpf -" \
  1837. --- 28,32 ----
  1838.   
  1839. ! tar cvf - "$@" | compress | \
  1840.       mhn -viamail "$mailpath" -viasubj "$subject" \
  1841. !     -viaparm "type=tar; x-conversions=x-compress" \
  1842.       -viacmnt "extract with uncompress | tar xvpf -" \
  1843. *** ../mh-6.8/support/pop/popd.c    Tue Dec 15 08:55:50 1992
  1844. --- support/pop/popd.c    Fri Feb 26 14:11:25 1993
  1845. ***************
  1846. *** 1,6 ****
  1847.   /* popd.c - the POP server */
  1848.   #ifndef    lint
  1849. ! static char ident[] = "@(#)$Id: popd.c,v 1.13 1992/12/15 00:20:22 jromine Exp $";
  1850.   #endif    /* lint */
  1851.   
  1852.   /* Author:    Marshall T. Rose    <MRose@UDel>    (MTR)
  1853. --- 1,6 ----
  1854.   /* popd.c - the POP server */
  1855.   #ifndef    lint
  1856. ! static char ident[] = "@(#)$Id: popd.c,v 1.15 1993/02/26 22:11:12 jromine Exp $";
  1857.   #endif    /* lint */
  1858.   
  1859.   /* Author:    Marshall T. Rose    <MRose@UDel>    (MTR)
  1860. ***************
  1861. *** 60,66 ****
  1862. --- 60,68 ----
  1863.   extern int  errno;
  1864.   extern int  sys_nerr;
  1865.   extern char *sys_errlist[];
  1866. + #ifndef    BSD44        /* const */
  1867.   extern char *sys_siglist[];
  1868. + #endif
  1869.   
  1870.   
  1871.   int  debug = 0;
  1872. ***************
  1873. *** 83,89 ****
  1874.   static AUTH_DAT kdata;
  1875.   #endif
  1876.   
  1877. ! static int    chldser ();
  1878.   void    padios (), padvise ();
  1879.   
  1880.   static    server(), arginit(), envinit();
  1881. --- 85,91 ----
  1882.   static AUTH_DAT kdata;
  1883.   #endif
  1884.   
  1885. ! static TYPESIG    chldser ();
  1886.   void    padios (), padvise ();
  1887.   
  1888.   static    server(), arginit(), envinit();
  1889. ***************
  1890. *** 258,264 ****
  1891.   #endif    /* BSD43 */
  1892.       port = ntohs (sin -> sin_port);
  1893.       addr = &sin -> sin_addr;
  1894. !     hp = gethostbyaddr (addr, sizeof *addr, sin -> sin_family);
  1895.       padvise (NULLCP, LOG_INFO, "servicing %s/%d",
  1896.           hp ? hp -> h_name : inet_ntoa (*addr), port);
  1897.       if (fd != 0)
  1898. --- 260,266 ----
  1899.   #endif    /* BSD43 */
  1900.       port = ntohs (sin -> sin_port);
  1901.       addr = &sin -> sin_addr;
  1902. !     hp = gethostbyaddr ((char *)addr, sizeof *addr, sin -> sin_family);
  1903.       padvise (NULLCP, LOG_INFO, "servicing %s/%d",
  1904.           hp ? hp -> h_name : inet_ntoa (*addr), port);
  1905.       if (fd != 0)
  1906. ***************
  1907. *** 404,418 ****
  1908.   
  1909.   #ifdef    SIGCHLD
  1910.   
  1911. ! static int chldser (sig, code, sc)
  1912.   int    sig;
  1913.   long    code;
  1914.   struct sigcontext *sc;
  1915.   {
  1916.   #if defined(BSD42) && !defined(WAITINT)
  1917. -     int status;
  1918. - #else
  1919.       union wait status;
  1920.   #endif
  1921.   
  1922.       while (wait3 (&status, WNOHANG, NULLRP) > 0)
  1923. --- 406,420 ----
  1924.   
  1925.   #ifdef    SIGCHLD
  1926.   
  1927. ! static TYPESIG chldser (sig, code, sc)
  1928.   int    sig;
  1929.   long    code;
  1930.   struct sigcontext *sc;
  1931.   {
  1932.   #if defined(BSD42) && !defined(WAITINT)
  1933.       union wait status;
  1934. + #else
  1935. +     int status;
  1936.   #endif
  1937.   
  1938.       while (wait3 (&status, WNOHANG, NULLRP) > 0)
  1939. *** ../mh-6.8/support/pop/popser.c    Tue Dec 15 08:55:50 1992
  1940. --- support/pop/popser.c    Fri Feb 26 14:12:11 1993
  1941. ***************
  1942. *** 1,6 ****
  1943.   /* popser.c - the POP service */
  1944.   #ifndef    lint
  1945. ! static char ident[]="@(#)$Id: popser.c,v 1.29 1992/12/15 00:20:22 jromine Exp $";
  1946.   #endif
  1947.   
  1948.   #include "../h/mh.h"
  1949. --- 1,6 ----
  1950.   /* popser.c - the POP service */
  1951.   #ifndef    lint
  1952. ! static char ident[]="@(#)$Id: popser.c,v 1.30 1992/12/16 22:31:20 jromine Exp $";
  1953.   #endif
  1954.   
  1955.   #include "../h/mh.h"
  1956. ***************
  1957. *** 215,221 ****
  1958.   #define    TRMLEN    (sizeof TRM - 1)
  1959.   #define    IAC    255
  1960.   
  1961. ! static int    pipeser ();
  1962.   
  1963.   FILE   *input;
  1964.   FILE   *output;
  1965. --- 215,221 ----
  1966.   #define    TRMLEN    (sizeof TRM - 1)
  1967.   #define    IAC    255
  1968.   
  1969. ! static TYPESIG    pipeser ();
  1970.   
  1971.   FILE   *input;
  1972.   FILE   *output;
  1973. ***************
  1974. *** 1861,1867 ****
  1975.   
  1976.   /* ARGSUSED */
  1977.   
  1978. ! static int pipeser (sig, code, sc)
  1979.   int    sig;
  1980.   long    code;
  1981.   struct sigcontext *sc;
  1982. --- 1861,1867 ----
  1983.   
  1984.   /* ARGSUSED */
  1985.   
  1986. ! static TYPESIG pipeser (sig, code, sc)
  1987.   int    sig;
  1988.   long    code;
  1989.   struct sigcontext *sc;
  1990. *** ../mh-6.8/support/pop/syslog.c    Tue Dec 15 08:55:52 1992
  1991. --- support/pop/syslog.c    Wed Dec 16 13:49:23 1992
  1992. ***************
  1993. *** 3,9 ****
  1994.   static char SccsId[] =    "@(#)syslog.c    4.1 (Berkeley) 5/27/83";
  1995.   #endif
  1996.   #ifndef    lint
  1997. ! static char ident[] = "@(#)$Id: syslog.c,v 1.8 1992/12/15 00:20:22 jromine Exp $";
  1998.   #endif    /* lint */
  1999.   
  2000.   /*
  2001. --- 3,9 ----
  2002.   static char SccsId[] =    "@(#)syslog.c    4.1 (Berkeley) 5/27/83";
  2003.   #endif
  2004.   #ifndef    lint
  2005. ! static char ident[] = "@(#)$Id: syslog.c,v 1.8 1992/12/15 00:20:22 jromine Exp jromine $";
  2006.   #endif    /* lint */
  2007.   
  2008.   /*
  2009. *** ../mh-6.8/uip/aliasbr.c    Tue Dec 15 08:55:53 1992
  2010. --- uip/aliasbr.c    Fri Feb 26 13:58:40 1993
  2011. ***************
  2012. *** 1,10 ****
  2013.   /* aliasbr.c - new aliasing mechanism */
  2014.   #ifndef    lint
  2015. ! static char ident[] = "@(#)$Id: aliasbr.c,v 1.13 1992/12/15 00:20:22 jromine Exp $";
  2016.   #endif    /* lint */
  2017.   
  2018.   #include "../h/mh.h"
  2019.   #include "../h/aliasbr.h"
  2020.   #include <ctype.h>
  2021.   #include <grp.h>
  2022.   #include <pwd.h>
  2023. --- 1,13 ----
  2024.   /* aliasbr.c - new aliasing mechanism */
  2025.   #ifndef    lint
  2026. ! static char ident[] = "@(#)$Id: aliasbr.c,v 1.14 1993/02/26 21:58:38 jromine Exp $";
  2027.   #endif    /* lint */
  2028.   
  2029.   #include "../h/mh.h"
  2030.   #include "../h/aliasbr.h"
  2031. + #ifdef    BSD44
  2032. + #include <sys/types.h>
  2033. + #endif
  2034.   #include <ctype.h>
  2035.   #include <grp.h>
  2036.   #include <pwd.h>
  2037. *** ../mh-6.8/uip/bbc.c    Tue Dec 15 08:55:54 1992
  2038. --- uip/bbc.c    Fri Feb 26 13:59:00 1993
  2039. ***************
  2040. *** 1,6 ****
  2041.   /* bbc.c - ZOTnet BBoard checker */
  2042.   #ifndef    lint
  2043. ! static char ident[] = "@(#)$Id: bbc.c,v 2.12 1992/12/14 17:10:25 jromine Exp $";
  2044.   #endif    lint
  2045.   
  2046.   #include "../h/mh.h"
  2047. --- 1,6 ----
  2048.   /* bbc.c - ZOTnet BBoard checker */
  2049.   #ifndef    lint
  2050. ! static char ident[] = "@(#)$Id: bbc.c,v 2.13 1993/02/26 21:58:57 jromine Exp $";
  2051.   #endif    lint
  2052.   
  2053.   #include "../h/mh.h"
  2054. ***************
  2055. *** 137,147 ****
  2056.   static char  **getip ();
  2057.   #endif    BPOP
  2058.   
  2059. ! int    sigser (), action ();
  2060. ! int    hupser ();
  2061.   #ifdef    SIGTSTP
  2062.   int    tstpid;
  2063. ! static  int    tstpser ();
  2064.   #endif    SIGTSTP
  2065.   
  2066.   static char *rcfile=NULL;
  2067. --- 137,147 ----
  2068.   static char  **getip ();
  2069.   #endif    BPOP
  2070.   
  2071. ! TYPESIG    sigser (), hupser ();
  2072. ! int    action ();
  2073.   #ifdef    SIGTSTP
  2074.   int    tstpid;
  2075. ! static  TYPESIG    tstpser ();
  2076.   #endif    SIGTSTP
  2077.   
  2078.   static char *rcfile=NULL;
  2079. ***************
  2080. *** 693,699 ****
  2081.   
  2082.   /* ARGSUSED */
  2083.   
  2084. ! int    sigser (i)
  2085.   int     i;
  2086.   {
  2087.   #ifndef    BSD42
  2088. --- 693,699 ----
  2089.   
  2090.   /* ARGSUSED */
  2091.   
  2092. ! TYPESIG    sigser (i)
  2093.   int     i;
  2094.   {
  2095.   #ifndef    BSD42
  2096. ***************
  2097. *** 705,711 ****
  2098.   
  2099.   /* ARGSUSED */
  2100.   
  2101. ! int    hupser (i)
  2102.   int    i;
  2103.   {
  2104.       static int armed = 0;
  2105. --- 705,711 ----
  2106.   
  2107.   /* ARGSUSED */
  2108.   
  2109. ! TYPESIG    hupser (i)
  2110.   int    i;
  2111.   {
  2112.       static int armed = 0;
  2113. ***************
  2114. *** 813,819 ****
  2115.   /*   */
  2116.   
  2117.   #ifdef    SIGTSTP
  2118. ! static int  tstpser (sig)
  2119.   int    sig;
  2120.   {
  2121.       int        pid;
  2122. --- 813,819 ----
  2123.   /*   */
  2124.   
  2125.   #ifdef    SIGTSTP
  2126. ! static TYPESIG  tstpser (sig)
  2127.   int    sig;
  2128.   {
  2129.       int        pid;
  2130. *** ../mh-6.8/uip/ftpsbr.c    Tue Dec 15 08:55:56 1992
  2131. --- uip/ftpsbr.c    Fri Aug 20 08:49:57 1993
  2132. ***************
  2133. *** 1,7 ****
  2134.   /* ftpsbr.c - simple FTP client library (why doesn't BSD have one?!?) */
  2135.   
  2136.   #ifndef    lint
  2137. ! static char ident[] = "@(#)$Id: ftpsbr.c,v 1.10 1992/12/03 16:50:27 jromine Exp $";
  2138.   #endif
  2139.   
  2140.   #include "../h/mh.h"
  2141. --- 1,7 ----
  2142.   /* ftpsbr.c - simple FTP client library (why doesn't BSD have one?!?) */
  2143.   
  2144.   #ifndef    lint
  2145. ! static char ident[] = "@(#)$Id: ftpsbr.c,v 1.12 1993/08/20 15:49:47 jromine Exp $";
  2146.   #endif
  2147.   
  2148.   #include "../h/mh.h"
  2149. ***************
  2150. *** 49,57 ****
  2151.   #define u_long  ulong
  2152.   #endif
  2153.   
  2154. - /* taken from ISODE's compat/internet.c */
  2155.   #include <sys/types.h>
  2156.   #include <sys/socket.h>
  2157.   #include <netinet/in.h>
  2158. --- 49,54 ----
  2159. ***************
  2160. *** 64,114 ****
  2161.   #define    inaddr_copy(hp,sin) \
  2162.       bcopy ((hp) -> h_addr, (char *) &((sin) -> sin_addr), (hp) -> h_length)
  2163.   
  2164. - #ifndef    DG
  2165. - u_long    inet_addr ();
  2166. - #else
  2167. - struct in_addr inet_addr ();
  2168. - #endif
  2169.   
  2170.   
  2171. - static char *empty = NULL;
  2172. - #ifdef    h_addr
  2173. - static char *addrs[2] = { NULL };
  2174. - #endif
  2175. - static struct hostent *gethostbystring (s)
  2176. - char   *s;
  2177. - {
  2178. -     register struct hostent *h;
  2179. - #ifndef    DG
  2180. -     static u_long iaddr;
  2181. - #else
  2182. -     static struct in_addr iaddr;
  2183. - #endif
  2184. -     static struct hostent   hs;
  2185. -     iaddr = inet_addr (s);
  2186. - #ifndef    DG
  2187. -     if (iaddr == NOTOK && strcmp (s, "255.255.255.255"))
  2188. - #else
  2189. -     if (iaddr.s_addr == NOTOK && strcmp (s, "255.255.255.255"))
  2190. - #endif
  2191. -     return gethostbyname (s);
  2192. -     h = &hs;
  2193. -     h -> h_name = s;
  2194. -     h -> h_aliases = ∅
  2195. -     h -> h_addrtype = AF_INET;
  2196. -     h -> h_length = sizeof (iaddr);
  2197. - #ifdef    h_addr
  2198. -     h -> h_addr_list = addrs;
  2199. -     bzero ((char *) addrs, sizeof addrs);
  2200. - #endif
  2201. -     h -> h_addr = (char *) &iaddr;
  2202. -     return h;
  2203. - }
  2204.   /*   */
  2205.   
  2206.   extern    int    errno;
  2207. --- 61,69 ----
  2208.   #define    inaddr_copy(hp,sin) \
  2209.       bcopy ((hp) -> h_addr, (char *) &((sin) -> sin_addr), (hp) -> h_length)
  2210.   
  2211.   
  2212. + struct hostent *gethostbystring ();
  2213.   
  2214.   /*   */
  2215.   
  2216.   extern    int    errno;
  2217. ***************
  2218. *** 226,231 ****
  2219. --- 181,204 ----
  2220.   int    ascii,
  2221.       stayopen;
  2222.   {
  2223. +     return ftp_trans (host, user, password, cwd, remote, local, "RETR", ascii,
  2224. +               stayopen);
  2225. + }
  2226. + /*   */
  2227. + int    ftp_trans (host, user, password, cwd, remote, local, cmd, ascii,
  2228. +            stayopen)
  2229. + char   *host,
  2230. +        *user,
  2231. +        *password,
  2232. +        *cwd,
  2233. +        *remote,
  2234. +        *local,
  2235. +        *cmd;
  2236. + int    ascii,
  2237. +     stayopen;
  2238. + {
  2239.       int        result;
  2240.   
  2241.       if (stayopen <= 0) {
  2242. ***************
  2243. *** 292,298 ****
  2244.       goto out;
  2245.       }
  2246.   
  2247. !     result = ftp_read (remote, local, ascii);
  2248.   
  2249.   out: ;
  2250.       if (result != OK || !stayopen)
  2251. --- 265,271 ----
  2252.       goto out;
  2253.       }
  2254.   
  2255. !     result = ftp_read (remote, local, cmd, ascii);
  2256.   
  2257.   out: ;
  2258.       if (result != OK || !stayopen)
  2259. ***************
  2260. *** 319,344 ****
  2261.   
  2262.   /*   */
  2263.   
  2264. ! static int  ftp_read (remote, local, ascii)
  2265.   char    *remote,
  2266. !     *local;
  2267.   int    ascii;
  2268.   {
  2269.       register int    cc;
  2270.       int        expectingreply = 0;
  2271.       char    buffer[BUFSIZ];
  2272. !     FILE   *fp;
  2273.   
  2274.       if (initconn () == NOTOK)
  2275.       goto bad;
  2276.   
  2277.       v_noise = v_verbose;
  2278. !     if (command (-1, "RETR %s", remote) != PRELIM)
  2279.       goto bad;
  2280.   
  2281.       expectingreply++;
  2282.       if (dataconn () == NOTOK) {
  2283.   bad: ;
  2284.       if (data_fd != NOTOK)
  2285.           (void) close_tcp_socket (data_fd), data_fd = NOTOK;
  2286.       if (expectingreply)
  2287. --- 292,322 ----
  2288.   
  2289.   /*   */
  2290.   
  2291. ! static int  ftp_read (remote, local, cmd, ascii)
  2292.   char    *remote,
  2293. !     *local,
  2294. !     *cmd;
  2295.   int    ascii;
  2296.   {
  2297. +     int        istdio = 0,
  2298. +         istore;
  2299.       register int    cc;
  2300.       int        expectingreply = 0;
  2301.       char    buffer[BUFSIZ];
  2302. !     FILE   *fp = NULL;
  2303.   
  2304.       if (initconn () == NOTOK)
  2305.       goto bad;
  2306.   
  2307.       v_noise = v_verbose;
  2308. !     if (command (-1, *remote ? "%s %s" : "%s", cmd, remote) != PRELIM)
  2309.       goto bad;
  2310.   
  2311.       expectingreply++;
  2312.       if (dataconn () == NOTOK) {
  2313.   bad: ;
  2314. +         if (fp && !istdio)
  2315. +         (void) fclose (fp);
  2316.       if (data_fd != NOTOK)
  2317.           (void) close_tcp_socket (data_fd), data_fd = NOTOK;
  2318.       if (expectingreply)
  2319. ***************
  2320. *** 347,407 ****
  2321.       return NOTOK;
  2322.       }
  2323.   
  2324. !     if ((fp = fopen (local, "w")) == NULL) {
  2325. !     perror (local);
  2326. !     goto bad;
  2327. !     }
  2328.   
  2329. !     if (ascii) {
  2330. !     int    c;
  2331. !     FILE   *in;
  2332. !     if (!(in = fdopen (data_fd, "r"))) {
  2333. !         perror ("fdopen");
  2334.           goto bad;
  2335.       }
  2336. -     while ((c = getc (in)) != EOF) {
  2337. -         if (c == '\r')
  2338. -         switch (c = getc (in)) {
  2339. -             case EOF:
  2340. -             case '\0':
  2341. -                 c = '\r';
  2342. -             break;
  2343.   
  2344. !             case '\n':
  2345. !             break;
  2346.   
  2347. !             default:
  2348. !             (void) putc ('\r', fp);
  2349. !             break;
  2350. !         }
  2351. !         if (putc (c, fp) == EOF) {
  2352. !         perror ("putc");
  2353. !         (void) fclose (in);
  2354. !         data_fd = NOTOK;
  2355.           goto bad;
  2356.           }
  2357.       }
  2358.   
  2359. !     (void) fclose (in);
  2360. !     data_fd = NOTOK;
  2361.       }
  2362.       else {
  2363. !     while ((cc = read_tcp_socket (data_fd, buffer, sizeof buffer)) > 0)
  2364. !         if (fwrite (buffer, sizeof *buffer, cc, fp) == 0) {
  2365. !         perror ("fwrite");
  2366.           goto bad;
  2367.           }
  2368. !     if (cc < 0) {
  2369. !         perror ("read_tcp_socket");
  2370. !         goto bad;
  2371.       }
  2372.   
  2373. !     (void) close_tcp_socket (data_fd), data_fd = NOTOK;
  2374.       }
  2375.   
  2376. !     (void) fclose (fp);
  2377.   
  2378.       v_noise = v_verbose;
  2379.       return (getreply (1, 0) == COMPLETE ? OK : NOTOK);
  2380. --- 325,428 ----
  2381.       return NOTOK;
  2382.       }
  2383.   
  2384. !     istore = !strcmp (cmd, "STOR");
  2385.   
  2386. !     if (istdio = !strcmp (local, "-"))
  2387. !     fp = istore ? stdin : stdout;
  2388. !     else
  2389. !     if ((fp = fopen (local, istore ? "r" : "w")) == NULL) {
  2390. !         perror (local);
  2391.           goto bad;
  2392.       }
  2393.   
  2394. !     if (istore) {
  2395. !     if (ascii) {
  2396. !         int        c;
  2397. !         FILE   *out;
  2398.   
  2399. !         if (!(out = fdopen (data_fd, "w"))) {
  2400. !         perror ("fdopen");
  2401.           goto bad;
  2402.           }
  2403. +         while ((c = getc (fp)) != EOF) {
  2404. +         if (c == '\n')
  2405. +             (void) putc ('\r', out);
  2406. +         if (putc (c, out) == EOF) {
  2407. +             perror ("putc");
  2408. +             (void) fclose (out);
  2409. +             data_fd = NOTOK;
  2410. +             goto bad;
  2411. +         }
  2412. +         }
  2413. +         (void) fclose (out);
  2414. +         data_fd = NOTOK;
  2415.       }
  2416. +     else {
  2417. +         while ((cc = fread (buffer, sizeof *buffer, sizeof buffer, fp)) >0)
  2418. +         if (write_tcp_socket (data_fd, buffer, cc) != cc) {
  2419. +             perror ("write_tcp_socket");
  2420. +             goto bad;
  2421. +         }
  2422.   
  2423. !         (void) close_tcp_socket (data_fd), data_fd = NOTOK;
  2424. !     }
  2425.       }
  2426.       else {
  2427. !     if (ascii) {
  2428. !         int        c;
  2429. !         FILE   *in;
  2430. !         if (!(in = fdopen (data_fd, "r"))) {
  2431. !         perror ("fdopen");
  2432.           goto bad;
  2433.           }
  2434. !         while ((c = getc (in)) != EOF) {
  2435. !         if (c == '\r')
  2436. !             switch (c = getc (in)) {
  2437. !                 case EOF:
  2438. !                 case '\0':
  2439. !                     c = '\r';
  2440. !                 break;
  2441. !             case '\n':
  2442. !                 break;
  2443. !             default:
  2444. !                 (void) putc ('\r', fp);
  2445. !                 break;
  2446. !             }
  2447. !         if (putc (c, fp) == EOF) {
  2448. !             perror ("putc");
  2449. !             (void) fclose (in);
  2450. !             data_fd = NOTOK;
  2451. !             goto bad;
  2452. !         }
  2453. !         }
  2454. !         (void) fclose (in);
  2455. !         data_fd = NOTOK;
  2456.       }
  2457. +     else {
  2458. +         while ((cc = read_tcp_socket (data_fd, buffer, sizeof buffer)) > 0)
  2459. +         if (fwrite (buffer, sizeof *buffer, cc, fp) == 0) {
  2460. +             perror ("fwrite");
  2461. +             goto bad;
  2462. +         }
  2463. +         if (cc < 0) {
  2464. +         perror ("read_tcp_socket");
  2465. +         goto bad;
  2466. +         }
  2467.   
  2468. !         (void) close_tcp_socket (data_fd), data_fd = NOTOK;
  2469. !     }
  2470.       }
  2471.   
  2472. !     if (!istdio)
  2473. !     (void) fclose (fp);
  2474.   
  2475.       v_noise = v_verbose;
  2476.       return (getreply (1, 0) == COMPLETE ? OK : NOTOK);
  2477. ***************
  2478. *** 488,494 ****
  2479.   
  2480.       va_start (ap);
  2481.   
  2482. !     val = _command (va_arg (ap, int), ap);
  2483.   
  2484.       va_end (ap);
  2485.   
  2486. --- 509,516 ----
  2487.   
  2488.       va_start (ap);
  2489.   
  2490. !     val = va_arg (ap, int);
  2491. !     val = _command (val, ap);
  2492.   
  2493.       va_end (ap);
  2494.   
  2495. *** ../mh-6.8/uip/inc.c    Tue Dec 15 08:55:57 1992
  2496. --- uip/inc.c    Fri Aug 20 08:50:28 1993
  2497. ***************
  2498. *** 1,6 ****
  2499.   /* inc.c - incorporate messages from a maildrop into a folder */
  2500.   #ifndef    lint
  2501. ! static char ident[] = "@(#)$Id: inc.c,v 1.20 1992/12/15 00:20:22 jromine Exp $";
  2502.   #endif    /* lint */
  2503.   
  2504.   #ifdef    MAILGROUP
  2505. --- 1,6 ----
  2506.   /* inc.c - incorporate messages from a maildrop into a folder */
  2507.   #ifndef    lint
  2508. ! static char ident[] = "@(#)$Id: inc.c,v 1.21 1993/08/20 15:50:13 jromine Exp $";
  2509.   #endif    /* lint */
  2510.   
  2511.   #ifdef    MAILGROUP
  2512. ***************
  2513. *** 408,418 ****
  2514.       }
  2515.   #ifdef    POP
  2516.       else if (host) {
  2517. !     if (rpop) {
  2518. !         if (user == NULL)
  2519. !         user = getusr ();
  2520.           pass = getusr ();
  2521. -     }
  2522.       else
  2523.           ruserpass (host, &user, &pass);
  2524.   
  2525. --- 408,417 ----
  2526.       }
  2527.   #ifdef    POP
  2528.       else if (host) {
  2529. !     if (user == NULL)
  2530. !         user = getusr ();
  2531. !     if (rpop > 0)
  2532.           pass = getusr ();
  2533.       else
  2534.           ruserpass (host, &user, &pass);
  2535.   
  2536. ***************
  2537. *** 419,425 ****
  2538.       if (pop_init (host, user, pass, snoop, rpop) == NOTOK
  2539.           || pop_stat (&nmsgs, &nbytes) == NOTOK)
  2540.           adios (NULLCP, "%s", response);
  2541. !     if (rpop)
  2542.           (void) setuid (getuid ());
  2543.       if (nmsgs == 0) {
  2544.           (void) pop_quit ();
  2545. --- 418,424 ----
  2546.       if (pop_init (host, user, pass, snoop, rpop) == NOTOK
  2547.           || pop_stat (&nmsgs, &nbytes) == NOTOK)
  2548.           adios (NULLCP, "%s", response);
  2549. !     if (rpop > 0)
  2550.           (void) setuid (getuid ());
  2551.       if (nmsgs == 0) {
  2552.           (void) pop_quit ();
  2553. *** ../mh-6.8/uip/mhlsbr.c    Tue Dec 15 08:55:58 1992
  2554. --- uip/mhlsbr.c    Fri Aug 20 08:50:50 1993
  2555. ***************
  2556. *** 1,6 ****
  2557.   /* mhlsbr.c - implement the "nifty" message lister */
  2558.   #ifndef    lint
  2559. ! static char ident[] = "@(#)$Id: mhlsbr.c,v 1.28 1992/12/15 00:20:22 jromine Exp $";
  2560.   #endif    /* lint */
  2561.   
  2562.   #include "../h/mh.h"
  2563. --- 1,6 ----
  2564.   /* mhlsbr.c - implement the "nifty" message lister */
  2565.   #ifndef    lint
  2566. ! static char ident[] = "@(#)$Id: mhlsbr.c,v 1.29 1993/08/20 15:50:44 jromine Exp $";
  2567.   #endif    /* lint */
  2568.   
  2569.   #include "../h/mh.h"
  2570. ***************
  2571. *** 1532,1537 ****
  2572. --- 1532,1540 ----
  2573.   #include <arpa/inet.h>
  2574.   #endif
  2575.   
  2576. + struct hostent *gethostbystring ();
  2577.   static int  doface (c1)
  2578.   register struct mcomp *c1;
  2579.   {
  2580. ***************
  2581. *** 1557,1570 ****
  2582.           return (inited = NOTOK);
  2583.       }
  2584.   
  2585. !     if (hp = gethostbyname (ap[0]))
  2586. !         bcopy (hp -> h_addr, (char *) &addr, addrlen = hp -> h_length);
  2587. !     else
  2588. !         if (iaddr = inet_addr (ap[0]))
  2589. !         bcopy ((char *) &iaddr, (char *) &addr,
  2590. !             addrlen = sizeof iaddr);
  2591. !         else
  2592. !         goto bad_faceproc;
  2593.   
  2594.       portno = htons ((u_short) atoi (ap[1]));
  2595.       free (cp);
  2596. --- 1560,1568 ----
  2597.           return (inited = NOTOK);
  2598.       }
  2599.   
  2600. !     if (!(hp = gethostbystring (ap[0])))
  2601. !         goto bad_faceproc;
  2602. !     bcopy (hp -> h_addr, (char *) &addr, addrlen = hp -> h_length);
  2603.   
  2604.       portno = htons ((u_short) atoi (ap[1]));
  2605.       free (cp);
  2606. *** ../mh-6.8/uip/mhmail.c    Tue Dec 15 08:55:58 1992
  2607. --- uip/mhmail.c    Fri Aug 20 08:51:34 1993
  2608. ***************
  2609. *** 1,6 ****
  2610.   /* mhmail.c - simple mail program */
  2611.   #ifndef    lint
  2612. ! static char ident[] = "@(#)$Id: mhmail.c,v 1.8 1992/12/15 00:20:22 jromine Exp $";
  2613.   #endif    /* lint */
  2614.   
  2615.   #include "../h/mh.h"
  2616. --- 1,6 ----
  2617.   /* mhmail.c - simple mail program */
  2618.   #ifndef    lint
  2619. ! static char ident[] = "@(#)$Id: mhmail.c,v 1.9 1993/08/20 15:51:29 jromine Exp $";
  2620.   #endif    /* lint */
  2621.   
  2622.   #include "../h/mh.h"
  2623. ***************
  2624. *** 30,35 ****
  2625. --- 30,37 ----
  2626.   
  2627.   #define    RESNDSW    5
  2628.       "resent", -6,
  2629. + #define    QUEUESW    6
  2630. +     "queued", -6,
  2631.   
  2632.       NULL, 0
  2633.   };
  2634. ***************
  2635. *** 53,58 ****
  2636. --- 55,62 ----
  2637.           status,
  2638.               i,
  2639.               iscc = 0,
  2640. +         nvec,
  2641. +         queued = 0,
  2642.           resent = 0,
  2643.               somebody;
  2644.       char   *cp,
  2645. ***************
  2646. *** 62,68 ****
  2647.          *from = NULL,
  2648.              *body = NULL,
  2649.             **argp = argv + 1,
  2650. !             buf[100];
  2651.       FILE * out;
  2652.   
  2653.   #ifdef LOCALE
  2654. --- 66,73 ----
  2655.          *from = NULL,
  2656.              *body = NULL,
  2657.             **argp = argv + 1,
  2658. !             buf[100],
  2659. !        *vec[5];
  2660.       FILE * out;
  2661.   
  2662.   #ifdef LOCALE
  2663. ***************
  2664. *** 116,121 ****
  2665. --- 121,130 ----
  2666.           case RESNDSW: 
  2667.               resent++;
  2668.               continue;
  2669. +         case QUEUESW: 
  2670. +             queued++;
  2671. +             continue;
  2672.           }
  2673.       if (iscc)
  2674.           cclist = cclist ? add (cp, add (", ", cclist)) : getcpy (cp);
  2675. ***************
  2676. *** 164,169 ****
  2677. --- 173,187 ----
  2678.   
  2679.   /*   */
  2680.   
  2681. +     nvec = 0;
  2682. +     vec[nvec++] = r1bindex (postproc, '/');
  2683. +     vec[nvec++] = tmpfil;
  2684. +     if (resent)
  2685. +     vec[nvec++] = "-dist";
  2686. +     if (queued)
  2687. +     vec[nvec++] = "-queued";
  2688. +     vec[nvec] = 0;
  2689.       for (i = 0; (child_id = fork ()) == NOTOK && i < 5; i++)
  2690.       sleep (5);
  2691.       switch (child_id) {
  2692. ***************
  2693. *** 170,178 ****
  2694.       case NOTOK:         /* report failure and then send it */
  2695.           admonish (NULLCP, "unable to fork");
  2696.   
  2697. !     case OK: 
  2698. !         execlp (postproc, r1bindex (postproc, '/'), tmpfil,
  2699. !             resent ? "-dist" : NULLCP, NULLCP);
  2700.           fprintf (stderr, "unable to exec ");
  2701.           perror (postproc);
  2702.           _exit (-1);
  2703. --- 188,195 ----
  2704.       case NOTOK:         /* report failure and then send it */
  2705.           admonish (NULLCP, "unable to fork");
  2706.   
  2707. !     case OK:
  2708. !         execvp (postproc, vec);
  2709.           fprintf (stderr, "unable to exec ");
  2710.           perror (postproc);
  2711.           _exit (-1);
  2712. *** ../mh-6.8/uip/mhn.c    Tue Dec 15 08:55:59 1992
  2713. --- uip/mhn.c    Fri Aug 20 08:52:32 1993
  2714. ***************
  2715. *** 1,6 ****
  2716.   /* mhn.c - multi-media MH */
  2717.   #ifndef    lint
  2718. ! static char ident[] = "@(#)$Id: mhn.c,v 2.21 1992/12/15 00:20:22 jromine Exp $";
  2719.   #endif    /* lint */
  2720.   
  2721.   #include "../h/mh.h"
  2722. --- 1,6 ----
  2723.   /* mhn.c - multi-media MH */
  2724.   #ifndef    lint
  2725. ! static char ident[] = "@(#)$Id: mhn.c,v 2.22 1993/08/20 15:52:01 jromine Exp $";
  2726.   #endif    /* lint */
  2727.   
  2728.   #include "../h/mh.h"
  2729. ***************
  2730. *** 21,117 ****
  2731.   /*   */
  2732.   
  2733.   static struct swit switches[] = {
  2734. ! #define    AUTOSW      0
  2735.       "auto", 0,
  2736. ! #define    NAUTOSW      1
  2737.       "noauto", 0,
  2738.   
  2739. ! #define    DEBUGSW      2
  2740.       "debug", -5,
  2741.       
  2742. ! #define    EBCDICSW  3
  2743.       "ebcdicsafe", 0,
  2744. ! #define    NEBCDICSW 4
  2745.       "noebcdicsafe", 0,
  2746.   
  2747. ! #define    FORMSW      5
  2748.       "form formfile", 4,
  2749.   
  2750. ! #define    HEADSW      6
  2751.       "headers", 0,
  2752. ! #define    NHEADSW      7
  2753.       "noheaders", 0,
  2754.   
  2755. ! #define    LISTSW      8
  2756.       "list", 0,
  2757. ! #define    NLISTSW      9
  2758.       "nolist", 0,
  2759.   
  2760. ! #define    PARTSW     10
  2761.       "part number", 0,
  2762.   
  2763. ! #define    SIZESW     11
  2764.       "realsize", 0,
  2765. ! #define    NSIZESW     12
  2766.       "norealsize", 0,
  2767.   
  2768. ! #define    RFC934SW 13
  2769.       "rfc934mode", 0,
  2770. ! #define    NRFC934SW 14
  2771.       "norfc934mode", 0,
  2772.   
  2773. ! #define    SERIALSW 15
  2774.       "serialonly", 0,
  2775. ! #define    NSERIALSW 16
  2776.       "noserialonly", 0,
  2777.   
  2778. ! #define    SHOWSW     17
  2779.       "show", 0,
  2780. ! #define    NSHOWSW     18
  2781.       "noshow", 0,
  2782.   
  2783. ! #define    STORESW     19
  2784.       "store", 0,
  2785. ! #define    NSTORESW 20
  2786.       "nostore", 0,
  2787.   
  2788. ! #define    TYPESW     21
  2789.       "type content", 0,
  2790.   
  2791. ! #define    VERBSW     22
  2792.       "verbose", 0,
  2793. ! #define    NVERBSW     23
  2794.       "noverbose", 0,
  2795.       
  2796. ! #define    HELPSW     24
  2797.       "help", 4,
  2798.   
  2799. ! #define    PROGSW   25
  2800.       "moreproc program", -4,
  2801. ! #define    NPROGSW     26
  2802.       "nomoreproc", -3,
  2803.   
  2804. ! #define    LENSW     27
  2805.       "length lines", -4,
  2806. ! #define    WIDSW     28
  2807.       "width columns", -4,
  2808.   
  2809. ! #define    FILESW     29        /* interface from show */
  2810.       "file file", -4,
  2811.   
  2812. ! #define    VIAMSW     30
  2813.       "viamail mailpath", -7,
  2814. ! #define    VIASSW     31
  2815.       "viasubj subject", -7,
  2816. ! #define    VIAPSW     32
  2817.       "viaparm arguments", -7,
  2818. ! #define    VIADSW     33
  2819.       "viadesc text", -7,
  2820. ! #define    VIACSW     34
  2821.       "viacmnt text", -7,
  2822. ! #define    VIAZSW     35
  2823.       "viadelay seconds", -8,
  2824. ! #define    VIAFSW     36
  2825.       "viafrom mailpath", -7,
  2826.   
  2827.       NULL, 0
  2828. --- 21,130 ----
  2829.   /*   */
  2830.   
  2831.   static struct swit switches[] = {
  2832. ! #define    AUTOSW       0
  2833.       "auto", 0,
  2834. ! #define    NAUTOSW       1
  2835.       "noauto", 0,
  2836.   
  2837. ! #define    CACHESW       2
  2838. !     "cache policy", 0,
  2839. ! #define    CHECKSW    3
  2840. !     "check", 0,
  2841. ! #define    NCHECKSW   4
  2842. !     "nocheck", 0,
  2843. ! #define    DEBUGSW       5
  2844.       "debug", -5,
  2845.       
  2846. ! #define    EBCDICSW   6
  2847.       "ebcdicsafe", 0,
  2848. ! #define    NEBCDICSW  7
  2849.       "noebcdicsafe", 0,
  2850.   
  2851. ! #define    FORMSW       8
  2852.       "form formfile", 4,
  2853.   
  2854. ! #define    HEADSW       9
  2855.       "headers", 0,
  2856. ! #define    NHEADSW      10
  2857.       "noheaders", 0,
  2858.   
  2859. ! #define    LISTSW      11
  2860.       "list", 0,
  2861. ! #define    NLISTSW      12
  2862.       "nolist", 0,
  2863.   
  2864. ! #define    PARTSW      13
  2865.       "part number", 0,
  2866.   
  2867. ! #define    PAUSESW      14
  2868. !     "pause", 0,
  2869. ! #define    NPAUSESW  15
  2870. !     "nopause", 0,
  2871. ! #define    SIZESW      16
  2872.       "realsize", 0,
  2873. ! #define    NSIZESW      17
  2874.       "norealsize", 0,
  2875.   
  2876. ! #define    RFC934SW  18
  2877.       "rfc934mode", 0,
  2878. ! #define    NRFC934SW 19
  2879.       "norfc934mode", 0,
  2880.   
  2881. ! #define    SERIALSW  20
  2882.       "serialonly", 0,
  2883. ! #define    NSERIALSW 21
  2884.       "noserialonly", 0,
  2885.   
  2886. ! #define    SHOWSW      22
  2887.       "show", 0,
  2888. ! #define    NSHOWSW      23
  2889.       "noshow", 0,
  2890.   
  2891. ! #define    STORESW      24
  2892.       "store", 0,
  2893. ! #define    NSTORESW  25
  2894.       "nostore", 0,
  2895.   
  2896. ! #define    TYPESW      26
  2897.       "type content", 0,
  2898.   
  2899. ! #define    VERBSW      27
  2900.       "verbose", 0,
  2901. ! #define    NVERBSW      28
  2902.       "noverbose", 0,
  2903.       
  2904. ! #define    HELPSW     29
  2905.       "help", 4,
  2906.   
  2907. ! #define    PROGSW   30
  2908.       "moreproc program", -4,
  2909. ! #define    NPROGSW     31
  2910.       "nomoreproc", -3,
  2911.   
  2912. ! #define    LENSW     32
  2913.       "length lines", -4,
  2914. ! #define    WIDSW     33
  2915.       "width columns", -4,
  2916.   
  2917. ! #define    FILESW     34        /* interface from show */
  2918.       "file file", -4,
  2919.   
  2920. ! #define    VIAMSW     35
  2921.       "viamail mailpath", -7,
  2922. ! #define    VIASSW     36
  2923.       "viasubj subject", -7,
  2924. ! #define    VIAPSW     37
  2925.       "viaparm arguments", -7,
  2926. ! #define    VIADSW     38
  2927.       "viadesc text", -7,
  2928. ! #define    VIACSW     39
  2929.       "viacmnt text", -7,
  2930. ! #define    VIAZSW     40
  2931.       "viadelay seconds", -8,
  2932. ! #define    VIAFSW     41
  2933.       "viafrom mailpath", -7,
  2934.   
  2935.       NULL, 0
  2936. ***************
  2937. *** 122,128 ****
  2938. --- 135,154 ----
  2939.   #define    NPARTS    50
  2940.   #define    NTYPES    20
  2941.   
  2942. + static struct swit caches[] = {
  2943. + #define    CACHE_ALWAYS    0
  2944. +     "always", 0,
  2945. + #define    CACHE_ASK    1
  2946. +     "ask", 0,
  2947. + #define    CACHE_NEVER    2
  2948. +     "never", 0,
  2949. +     NULL, 0
  2950. + };
  2951.   static    int    autosw = 0;
  2952. + static    int    cachesw = CACHE_ASK;
  2953. + static    int    checksw = 0;
  2954.       int    debugsw = 0;
  2955.   static    int    ebcdicsw = 0;
  2956.   static    char   *formsw = NULLCP;
  2957. ***************
  2958. *** 131,136 ****
  2959. --- 157,163 ----
  2960.   static    int    nomore = 0;
  2961.   static    int    npart = 0;
  2962.   static    char   *parts[NPARTS + 1];
  2963. + static    int    pausesw = 1;
  2964.   static    char   *progsw = NULLCP;
  2965.   static    int    rfc934sw = 1;
  2966.   static    int    serialsw = 0;
  2967. ***************
  2968. *** 219,225 ****
  2969.       caddr_t c_ctextern;        /*   .. */
  2970.       char   *c_showproc;        /* default, if not in profile */
  2971.       char   *c_termproc;        /* for charset madness... */
  2972. !     char   *c_storeproc;    /* default, if not in profile */
  2973.   
  2974.       int      (*c_ctinitfnx) ();    /* parse content */
  2975.       int      (*c_ctlistfnx) ();    /* list content */
  2976. --- 246,252 ----
  2977.       caddr_t c_ctextern;        /*   .. */
  2978.       char   *c_showproc;        /* default, if not in profile */
  2979.       char   *c_termproc;        /* for charset madness... */
  2980. !     char   *c_storeproc;    /* overrides profile entry, if any */
  2981.   
  2982.       int      (*c_ctinitfnx) ();    /* parse content */
  2983.       int      (*c_ctlistfnx) ();    /* list content */
  2984. ***************
  2985. *** 253,258 ****
  2986. --- 280,287 ----
  2987.       char   *c_id;        /* Content-ID: */
  2988.       char   *c_descr;        /* Content-Description: */
  2989.   
  2990. +     int        c_digested;        /* Content-MD5: */
  2991. +     unsigned char c_digest[16];    /*   .. */
  2992.   
  2993.       FILE   *c_fp;        /* read contents (stream) */
  2994.       char   *c_file;        /* read contents (file) */
  2995. ***************
  2996. *** 280,286 ****
  2997. --- 309,317 ----
  2998.   #endif
  2999.   
  3000.   static int   init_encoding(), type_ok(), copy_some_headers(), set_endian();
  3001. + static int   make_intermediates ();
  3002.   static int   write7Bit(), writeQuoted(), writeBase64(), writeBase64aux();
  3003. + static int   writeDigest (), readDigest ();
  3004.   static int   via_mail(), via_post(), pidcheck();
  3005.   
  3006.   static    CT    *cts = NULL;
  3007. ***************
  3008. *** 359,364 ****
  3009. --- 390,416 ----
  3010.               autosw = 0;
  3011.               continue;
  3012.   
  3013. +         case CACHESW:
  3014. +             if (!(cp = *argp++) || *cp == '-')
  3015. +             adios (NULLCP, "missing argument to %s", argp[-2]);
  3016. +             switch (cachesw = smatch (cp, caches)) {
  3017. +             case AMBIGSW:
  3018. +                 ambigsw (cp, caches);
  3019. +                 done (1);
  3020. +             case UNKWNSW:
  3021. +                 adios (NULLCP, "%s unknown", cp);
  3022. +             default:
  3023. +                 break;
  3024. +             }
  3025. +             continue;
  3026. +         case CHECKSW:
  3027. +             checksw++;
  3028. +             continue;
  3029. +         case NCHECKSW:
  3030. +             checksw = 0;
  3031. +             continue;
  3032.           case DEBUGSW:
  3033.               debugsw++;
  3034.               continue;
  3035. ***************
  3036. *** 402,407 ****
  3037. --- 454,466 ----
  3038.               parts[npart++] = cp;
  3039.               continue;
  3040.   
  3041. +         case PAUSESW:
  3042. +             pausesw++;
  3043. +             continue;
  3044. +         case NPAUSESW:
  3045. +             pausesw = 0;
  3046. +             continue;
  3047.           case RFC934SW:
  3048.               rfc934sw++;
  3049.               continue;
  3050. ***************
  3051. *** 527,533 ****
  3052.       /* NOTREACHED */
  3053.       }
  3054.       else
  3055. !     if (f2 || f3 || f4 || f5 || f6)
  3056.           adios (NULLCP, "missing -viamail \"mailpath\" switch");
  3057.   
  3058.       if (cp = getenv ("MHN")) {
  3059. --- 586,592 ----
  3060.       /* NOTREACHED */
  3061.       }
  3062.       else
  3063. !     if (f2 || f3 || f4 || f5 || f6 || f7)
  3064.           adios (NULLCP, "missing -viamail \"mailpath\" switch");
  3065.   
  3066.       if (cp = getenv ("MHN")) {
  3067. ***************
  3068. *** 546,552 ****
  3069.       }
  3070.   
  3071.       (void) sprintf (buf, "%s-cache", invo_name);
  3072. !     cache = m_find (buf);
  3073.   
  3074.       cwdlen = strlen (cwd = getcpy (pwd ()));
  3075.       (void) sprintf (buf, "%s-storage", invo_name);
  3076. --- 605,611 ----
  3077.       }
  3078.   
  3079.       (void) sprintf (buf, "%s-cache", invo_name);
  3080. !     cache = cachesw != CACHE_NEVER ? m_find (buf) : NULLCP;
  3081.   
  3082.       cwdlen = strlen (cwd = getcpy (pwd ()));
  3083.       (void) sprintf (buf, "%s-storage", invo_name);
  3084. ***************
  3085. *** 817,823 ****
  3086.               /* NOTREACHED */
  3087.   
  3088.           default:
  3089. !             xpid = child_id;
  3090.               break;
  3091.           }
  3092.   
  3093. --- 876,882 ----
  3094.               /* NOTREACHED */
  3095.   
  3096.           default:
  3097. !             xpid = -child_id;
  3098.               break;
  3099.           }
  3100.   
  3101. ***************
  3102. *** 896,912 ****
  3103.   };
  3104.   
  3105.   
  3106. ! static int InitApplication (), InitMessage (), InitMultiPart (), InitText ();
  3107.           
  3108.   
  3109.   static struct str2init str2cts[] = {
  3110.       "application",  CT_APPLICATION, InitApplication,
  3111. !     "audio",        CT_AUDIO,        NULL,
  3112. !     "image",        CT_IMAGE,        NULL,
  3113.       "message",        CT_MESSAGE,        InitMessage,
  3114.       "multipart",    CT_MULTIPART,   InitMultiPart,
  3115.       "text",        CT_TEXT,        InitText,
  3116. !     "video",        CT_VIDEO,        NULL,
  3117.   
  3118.       NULL,        CT_EXTENSION,   NULL,    /* these two must be last! */
  3119.       NULL,        CT_UNKNOWN,        NULL,
  3120. --- 955,972 ----
  3121.   };
  3122.   
  3123.   
  3124. ! static int InitApplication (), InitMessage (), InitMultiPart (), InitText (),
  3125. !            InitGeneric ();
  3126.           
  3127.   
  3128.   static struct str2init str2cts[] = {
  3129.       "application",  CT_APPLICATION, InitApplication,
  3130. !     "audio",        CT_AUDIO,        InitGeneric,
  3131. !     "image",        CT_IMAGE,        InitGeneric,
  3132.       "message",        CT_MESSAGE,        InitMessage,
  3133.       "multipart",    CT_MULTIPART,   InitMultiPart,
  3134.       "text",        CT_TEXT,        InitText,
  3135. !     "video",        CT_VIDEO,        InitGeneric,
  3136.   
  3137.       NULL,        CT_EXTENSION,   NULL,    /* these two must be last! */
  3138.       NULL,        CT_UNKNOWN,        NULL,
  3139. ***************
  3140. *** 952,958 ****
  3141.               compnum++;
  3142.   
  3143.           if (uleq (name, VRSN_FIELD)) {
  3144. !             register char  *cp;
  3145.   
  3146.               cp = add (buf, NULLCP);
  3147.               while (state == FLDPLUS) {
  3148. --- 1012,1021 ----
  3149.               compnum++;
  3150.   
  3151.           if (uleq (name, VRSN_FIELD)) {
  3152. !             int        ucmp;
  3153. !             char    c,
  3154. !                    *cp,
  3155. !                *dp;
  3156.   
  3157.               cp = add (buf, NULLCP);
  3158.               while (state == FLDPLUS) {
  3159. ***************
  3160. *** 961,971 ****
  3161.               }
  3162.   
  3163.               if (ct -> c_vrsn) {
  3164. -             char   *dp = trimcpy (cp);
  3165.               advise (NULLCP,
  3166.                   "message %s has multiple %s: fields (%s)",
  3167. !                 ct -> c_file, VRSN_FIELD, dp);
  3168.               free (dp);
  3169.               free (cp);
  3170.               goto out;
  3171. --- 1024,1032 ----
  3172.               }
  3173.   
  3174.               if (ct -> c_vrsn) {
  3175.               advise (NULLCP,
  3176.                   "message %s has multiple %s: fields (%s)",
  3177. !                 ct -> c_file, VRSN_FIELD, dp = trimcpy (cp));
  3178.               free (dp);
  3179.               free (cp);
  3180.               goto out;
  3181. ***************
  3182. *** 972,993 ****
  3183.               }
  3184.   
  3185.               ct -> c_vrsn = cp;
  3186. - #ifdef    whocares
  3187.               while (isspace (*cp))
  3188.               cp++;
  3189.               for (dp = cp; istoken (*dp); dp++)
  3190.               continue;
  3191. !             c = *dp, *dp = NULL;
  3192. !             if (!uleq (cp, VRSN_VALUE)) {
  3193. !             if (!isspace (c))
  3194. !                 *dp = c;
  3195. !             advise (NULLCP,
  3196. !                 "message %s has unsupported value for %s: field (%s)",
  3197. !                 ct -> c_file, VRSN_FIELD, cp);
  3198. !             goto out;
  3199. !             }
  3200.               *dp = c;
  3201. ! #endif
  3202.               goto got_header;
  3203.           }
  3204.   
  3205. --- 1033,1061 ----
  3206.               }
  3207.   
  3208.               ct -> c_vrsn = cp;
  3209.               while (isspace (*cp))
  3210.               cp++;
  3211. +             for (dp = index (cp, '\n'); dp; dp = index (dp, '\n'))
  3212. +             *dp++ = ' ';
  3213. +             for (dp = cp + strlen (cp) - 1; dp >= cp; dp--)
  3214. +             if (!isspace (*dp))
  3215. +                 break;
  3216. +             *++dp = '\0';
  3217. +             if (debugsw)
  3218. +             fprintf (stderr, "%s: %s\n", VRSN_FIELD, cp);
  3219. +             if (*cp == '(' && get_comment (ct, &cp, 0) == NOTOK)
  3220. +             goto out;
  3221.               for (dp = cp; istoken (*dp); dp++)
  3222.               continue;
  3223. !             c = *dp, *dp = '\0';
  3224. !             ucmp = uleq (cp, VRSN_VALUE);
  3225.               *dp = c;
  3226. !             if (!ucmp)
  3227. !             admonish (NULLCP,
  3228. !                 "message %s has unknown value for %s: field (%s)",
  3229. !                 ct -> c_file, VRSN_FIELD, cp);
  3230.               goto got_header;
  3231.           }
  3232.   
  3233. ***************
  3234. *** 1083,1088 ****
  3235. --- 1151,1209 ----
  3236.               goto got_header;
  3237.           }
  3238.   
  3239. +         if (uleq (name, MD5_FIELD)) {
  3240. +             char   *cp,
  3241. +                    *dp,
  3242. +                    *ep;
  3243. +             cp = add (buf, NULLCP);
  3244. +             while (state == FLDPLUS) {
  3245. +             state = m_getfld (state, name, buf, sizeof buf, in);
  3246. +             cp = add (buf, cp);
  3247. +             }
  3248. +             if (!checksw) {
  3249. +             free (cp);
  3250. +             goto got_header;
  3251. +             }
  3252. +             if (ct -> c_digested) {
  3253. +             advise (NULLCP,
  3254. +                 "message %s has multiple %s: fields (%s)",
  3255. +                 ct -> c_file, MD5_FIELD,
  3256. +                 dp = trimcpy (cp));
  3257. +             free (dp);
  3258. +             free (cp);
  3259. +             goto out;
  3260. +             }
  3261. +             ep = cp;
  3262. +             while (isspace (*cp))
  3263. +             cp++;
  3264. +             for (dp = index (cp, '\n'); dp; dp = index (dp, '\n'))
  3265. +             *dp++ = ' ';
  3266. +             for (dp = cp + strlen (cp) - 1; dp >= cp; dp--)
  3267. +             if (!isspace (*dp))
  3268. +                 break;
  3269. +             *++dp = '\0';
  3270. +             if (debugsw)
  3271. +             fprintf (stderr, "%s: %s\n", MD5_FIELD, cp);
  3272. +             if (*cp == '(' && get_comment (ct, &cp, 0) == NOTOK) {
  3273. +             free (ep);
  3274. +             goto out;
  3275. +             }
  3276. +             for (dp = cp; *dp && !isspace (*dp); dp++)
  3277. +             continue;
  3278. +             *dp = '\0';
  3279. +             (void) readDigest (ct, cp);
  3280. +             free (ep);
  3281. +             ct -> c_digested++;
  3282. +             goto got_header;
  3283. +         }
  3284.   #ifdef    notdef
  3285.           if (uprf (name, XXX_FIELD_PRF))
  3286.               advise (NULLCP, "unknown field (%s) in message %s",
  3287. ***************
  3288. *** 1177,1183 ****
  3289.       if (debugsw)
  3290.       fprintf (stderr, "%s: %s\n", TYPE_FIELD, cp);
  3291.   
  3292. !     if (*cp == '(' && get_comment (ct, &cp) == NOTOK)
  3293.       return NOTOK;
  3294.   
  3295.       for (dp = cp; istoken (*dp); dp++)
  3296. --- 1298,1304 ----
  3297.       if (debugsw)
  3298.       fprintf (stderr, "%s: %s\n", TYPE_FIELD, cp);
  3299.   
  3300. !     if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
  3301.       return NOTOK;
  3302.   
  3303.       for (dp = cp; istoken (*dp); dp++)
  3304. ***************
  3305. *** 1199,1205 ****
  3306.       while (isspace (*cp))
  3307.       cp++;
  3308.   
  3309. !     if (*cp == '(' && get_comment (ct, &cp) == NOTOK)
  3310.       return NOTOK;
  3311.   
  3312.       if (*cp != '/') {
  3313. --- 1320,1326 ----
  3314.       while (isspace (*cp))
  3315.       cp++;
  3316.   
  3317. !     if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
  3318.       return NOTOK;
  3319.   
  3320.       if (*cp != '/') {
  3321. ***************
  3322. *** 1212,1218 ****
  3323.       while (isspace (*cp))
  3324.       cp++;
  3325.   
  3326. !     if (*cp == '(' && get_comment (ct, &cp) == NOTOK)
  3327.       return NOTOK;
  3328.   
  3329.       for (dp = cp; istoken (*dp); dp++)
  3330. --- 1333,1339 ----
  3331.       while (isspace (*cp))
  3332.       cp++;
  3333.   
  3334. !     if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
  3335.       return NOTOK;
  3336.   
  3337.       for (dp = cp; istoken (*dp); dp++)
  3338. ***************
  3339. *** 1236,1242 ****
  3340.       while (isspace (*cp))
  3341.       cp++;
  3342.   
  3343. !     if (*cp == '(' && get_comment (ct, &cp) == NOTOK)
  3344.       return NOTOK;
  3345.   
  3346.       ep = (ap = ci -> ci_attrs) + NPARMS;
  3347. --- 1357,1363 ----
  3348.       while (isspace (*cp))
  3349.       cp++;
  3350.   
  3351. !     if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
  3352.       return NOTOK;
  3353.   
  3354.       ep = (ap = ci -> ci_attrs) + NPARMS;
  3355. ***************
  3356. *** 1255,1261 ****
  3357.       while (isspace (*cp))
  3358.           cp++;
  3359.   
  3360. !     if (*cp == '(' && get_comment (ct, &cp) == NOTOK)
  3361.           return NOTOK;
  3362.   
  3363.       if (*cp == 0) {
  3364. --- 1376,1382 ----
  3365.       while (isspace (*cp))
  3366.           cp++;
  3367.   
  3368. !     if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
  3369.           return NOTOK;
  3370.   
  3371.       if (*cp == 0) {
  3372. ***************
  3373. *** 1325,1331 ****
  3374.       while (isspace (*cp))
  3375.           cp++;
  3376.   
  3377. !     if (*cp == '(' && get_comment (ct, &cp) == NOTOK)
  3378.           return NOTOK;
  3379.       }
  3380.   
  3381. --- 1446,1452 ----
  3382.       while (isspace (*cp))
  3383.           cp++;
  3384.   
  3385. !     if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
  3386.           return NOTOK;
  3387.       }
  3388.   
  3389. ***************
  3390. *** 1365,1373 ****
  3391.   
  3392.   /*   */
  3393.   
  3394. ! static int  get_comment (ct, ap)
  3395.   CT    ct;
  3396.   char  **ap;
  3397.   {
  3398.       register int    i;
  3399.       register char  *bp,
  3400. --- 1486,1495 ----
  3401.   
  3402.   /*   */
  3403.   
  3404. ! static int  get_comment (ct, ap, istype)
  3405.   CT    ct;
  3406.   char  **ap;
  3407. + int    istype;
  3408.   {
  3409.       register int    i;
  3410.       register char  *bp,
  3411. ***************
  3412. *** 1386,1392 ****
  3413.           case '\0':
  3414.   invalid: ;
  3415.               advise (NULLCP, "invalid comment in message %s's %s: field",
  3416. !             ct -> c_file, TYPE_FIELD);
  3417.           return NOTOK;
  3418.   
  3419.           case '\\':
  3420. --- 1508,1514 ----
  3421.           case '\0':
  3422.   invalid: ;
  3423.               advise (NULLCP, "invalid comment in message %s's %s: field",
  3424. !             ct -> c_file, istype ? TYPE_FIELD : VRSN_FIELD);
  3425.           return NOTOK;
  3426.   
  3427.           case '\\':
  3428. ***************
  3429. *** 1413,1424 ****
  3430.       }
  3431.       *bp = '\0';
  3432.   
  3433. !     if (dp = ci -> ci_comment) {
  3434. !     ci -> ci_comment = concat (dp, " ", buffer, NULLCP);
  3435. !     free (dp);
  3436.       }
  3437. -     else
  3438. -     ci -> ci_comment = add (buffer, NULLCP);
  3439.   
  3440.       while (isspace (*cp))
  3441.       cp++;
  3442. --- 1535,1548 ----
  3443.       }
  3444.       *bp = '\0';
  3445.   
  3446. !     if (istype) {
  3447. !     if (dp = ci -> ci_comment) {
  3448. !         ci -> ci_comment = concat (dp, " ", buffer, NULLCP);
  3449. !         free (dp);
  3450. !     }
  3451. !     else
  3452. !         ci -> ci_comment = add (buffer, NULLCP);
  3453.       }
  3454.   
  3455.       while (isspace (*cp))
  3456.       cp++;
  3457. ***************
  3458. *** 1501,1507 ****
  3459.       fprintf (stderr, "  partno \"%s\"\n", empty (ct -> c_partno));
  3460.   
  3461.       if (ct -> c_vrsn)
  3462. !     fprintf (stderr, "  %s:%s", VRSN_FIELD, ct -> c_vrsn);
  3463.   
  3464.       if (ct -> c_ctline)
  3465.       fprintf (stderr, "  %s:%s", TYPE_FIELD, ct -> c_ctline);
  3466. --- 1625,1631 ----
  3467.       fprintf (stderr, "  partno \"%s\"\n", empty (ct -> c_partno));
  3468.   
  3469.       if (ct -> c_vrsn)
  3470. !     fprintf (stderr, "  %s:%s\n", VRSN_FIELD, ct -> c_vrsn);
  3471.   
  3472.       if (ct -> c_ctline)
  3473.       fprintf (stderr, "  %s:%s", TYPE_FIELD, ct -> c_ctline);
  3474. ***************
  3475. *** 1776,1782 ****
  3476.               break;
  3477.   
  3478.           case 'p':    /* pause prior to displaying content */
  3479. !             xpause = 1;
  3480.               /* and fall... */
  3481.           case 'l':    /* display listing prior to displaying
  3482.                      content */
  3483. --- 1900,1906 ----
  3484.               break;
  3485.   
  3486.           case 'p':    /* pause prior to displaying content */
  3487. !             xpause = pausesw;
  3488.               /* and fall... */
  3489.           case 'l':    /* display listing prior to displaying
  3490.                      content */
  3491. ***************
  3492. *** 1823,1829 ****
  3493.           fprintf (stderr, " using command %s\n", buffer);
  3494.       }
  3495.   
  3496. !     if (xtty && xpid) {
  3497.       (void) pidcheck (pidwait (xpid, NOTOK));
  3498.       xpid = 0;
  3499.       }
  3500. --- 1947,1955 ----
  3501.           fprintf (stderr, " using command %s\n", buffer);
  3502.       }
  3503.   
  3504. !     if (xpid < 0 || (xtty && xpid)) {
  3505. !     if (xpid < 0)
  3506. !         xpid = -xpid;
  3507.       (void) pidcheck (pidwait (xpid, NOTOK));
  3508.       xpid = 0;
  3509.       }
  3510. ***************
  3511. *** 2104,2109 ****
  3512. --- 2230,2239 ----
  3513.       }
  3514.    */
  3515.   
  3516. +     if (index (ct -> c_storage, '/')
  3517. +         && make_intermediates (ct -> c_storage) == NOTOK)
  3518. +     return NOTOK;
  3519.       if (ct -> c_encoding != CE_7BIT) {
  3520.       int    cc,
  3521.           fd;
  3522. ***************
  3523. *** 2234,2239 ****
  3524. --- 2364,2370 ----
  3525.   
  3526.           default:
  3527.               if (!uprf (buffer, XXX_FIELD_PRF)
  3528. +                 && !uprf (buffer, "Encrypted:")
  3529.                   && !uprf (buffer, "Message-ID:")) {
  3530.               appending = -1;
  3531.               buffer[0] = 0;
  3532. ***************
  3533. *** 2278,2284 ****
  3534.           case FLD:
  3535.           case FLDPLUS:
  3536.           case FLDEOF:
  3537. !         if (uprf (name, XXX_FIELD_PRF) || uleq (name, "Message-ID")) {
  3538.               while (state == FLDPLUS)
  3539.               state = m_getfld (state, name, buf, sizeof buf, in);
  3540.               continue;
  3541. --- 2409,2417 ----
  3542.           case FLD:
  3543.           case FLDPLUS:
  3544.           case FLDEOF:
  3545. !         if (uprf (name, XXX_FIELD_PRF)
  3546. !                 || uleq (name, "Encrypted")
  3547. !                 || uleq (name, "Message-ID")) {
  3548.               while (state == FLDPLUS)
  3549.               state = m_getfld (state, name, buf, sizeof buf, in);
  3550.               continue;
  3551. ***************
  3552. *** 2311,2316 ****
  3553. --- 2444,2489 ----
  3554.       return OK;
  3555.   }
  3556.   
  3557. + static int make_intermediates (file)
  3558. + char   *file;
  3559. + {
  3560. +     register char *cp;
  3561. +     for (cp = file; cp = index (cp, '/'); cp++) {
  3562. +     struct stat st;
  3563. +     *cp = NULL;
  3564. +     if (stat (file, &st) == NOTOK) {
  3565. +         int        answer;
  3566. +         char   *ep;
  3567. +         if (errno != ENOENT) {
  3568. +         advise (file, "error on directory");
  3569. + losing_directory: ;
  3570. +         *cp = '/';
  3571. +         return NOTOK;
  3572. +         }
  3573. +         ep = concat ("Create directory \"", file, "\"? ", NULLCP);
  3574. +         answer = getanswer (ep);
  3575. +         free (ep);
  3576. +         if (!answer)
  3577. +         goto losing_directory;
  3578. +         if (!makedir (file)) {
  3579. +         advise (NULLCP, "unable to create directory %s", file);
  3580. +         goto losing_directory;
  3581. +         }
  3582. +     }
  3583. +     *cp = '/';
  3584. +     }
  3585. +     return OK;
  3586. + }
  3587.   /*   */
  3588.   
  3589.   static void  free_ctinfo (ct)
  3590. ***************
  3591. *** 2427,2432 ****
  3592. --- 2600,2628 ----
  3593.       int        kv_value;
  3594.   };
  3595.   
  3596. + static int  InitGeneric (ct)
  3597. + register CT    ct;
  3598. + {
  3599. +     register char **ap,
  3600. +           **ep;
  3601. +     register CI    ci = &ct -> c_ctinfo;
  3602. +     for (ap = ci -> ci_attrs, ep = ci -> ci_values; *ap; ap++, ep++)
  3603. +     if (autosw && !ct -> c_storeproc && uleq (*ap, "x-name")) {
  3604. +         register char   *cp;
  3605. +         if (*(cp = *ep) != '/'
  3606. +             && *cp != '.'
  3607. +             && *cp != '|'
  3608. +             && *cp != '!'
  3609. +             && !index (cp, '%'))
  3610. +         ct -> c_storeproc = add (cp, NULLCP);
  3611. +     }
  3612. +     return OK;
  3613. + }
  3614.   /*     TEXT */
  3615.   
  3616.   #define    TEXT_UNKNOWN    0x00
  3617. ***************
  3618. *** 2489,2495 ****
  3619.       }
  3620.   
  3621.       for (ap = ci -> ci_attrs, ep = ci -> ci_values; *ap; ap++, ep++)
  3622. !     if (uleq (*ap, "charset")) {
  3623.           char   *cp;
  3624.           register struct text *t;
  3625.   
  3626. --- 2685,2691 ----
  3627.       }
  3628.   
  3629.       for (ap = ci -> ci_attrs, ep = ci -> ci_values; *ap; ap++, ep++)
  3630. !     if (!ct -> c_ctparams && uleq (*ap, "charset")) {
  3631.           char   *cp;
  3632.           register struct text *t;
  3633.   
  3634. ***************
  3635. *** 2510,2519 ****
  3636.           if ((!mm_charset || !uleq (mm_charset, *ep))
  3637.               && (cp = m_find (buffer)))
  3638.           ct -> c_termproc = getcpy (cp);
  3639. -         
  3640. -         break;
  3641.       }
  3642.   
  3643.       return OK;
  3644.   }
  3645.   
  3646. --- 2706,2724 ----
  3647.           if ((!mm_charset || !uleq (mm_charset, *ep))
  3648.               && (cp = m_find (buffer)))
  3649.           ct -> c_termproc = getcpy (cp);
  3650.       }
  3651. +         else
  3652. +         if (autosw && !ct -> c_storeproc && uleq (*ap, "x-name")) {
  3653. +         register char   *cp;
  3654.   
  3655. +         if (*(cp = *ep) != '/'
  3656. +                 && *cp != '.'
  3657. +                 && *cp != '|'
  3658. +                 && *cp != '!'
  3659. +                 && !index (cp, '%'))
  3660. +             ct -> c_storeproc = add (cp, NULLCP);
  3661. +         }
  3662.       return OK;
  3663.   }
  3664.   
  3665. ***************
  3666. *** 3130,3135 ****
  3667. --- 3335,3341 ----
  3668.       char   *eb_mode;
  3669.   
  3670.       char   *eb_server;
  3671. +     char   *eb_subject;
  3672.       char   *eb_body;
  3673.   
  3674.       unsigned long
  3675. ***************
  3676. *** 3212,3217 ****
  3677. --- 3418,3427 ----
  3678.           e -> eb_server = *ep;
  3679.           continue;
  3680.       }
  3681. +     if (uleq (*ap, "subject")) {
  3682. +         e -> eb_subject = *ep;
  3683. +         continue;
  3684. +     }
  3685.       if (composing && uleq (*ap, "body")) {
  3686.           e -> eb_body = getcpy (*ep);
  3687.           continue;
  3688. ***************
  3689. *** 3245,3250 ****
  3690. --- 3455,3462 ----
  3691.           printf ("\t         from %s\n", e -> eb_site);
  3692.       if (e -> eb_server)
  3693.           printf ("\t from mailbox %s\n", e -> eb_server);
  3694. +     if (e -> eb_subject)
  3695. +         printf ("\t with subject %s\n", e -> eb_subject);
  3696.       printf     ("\t        using %s", e -> eb_access);
  3697.       if (e -> eb_mode)
  3698.           printf (" (in %s mode)", e -> eb_mode);
  3699. ***************
  3700. *** 3527,3534 ****
  3701.   
  3702.   #define    APPLICATION_UNKNOWN    0x00
  3703.   #define    APPLICATION_OCTETS    0x01
  3704. ! #define    APPLICATION_ODA        0x02
  3705. ! #define    APPLICATION_POSTSCRIPT    0x03
  3706.   
  3707.   
  3708.   static int  list_application (ct, toplevel)
  3709. --- 3739,3745 ----
  3710.   
  3711.   #define    APPLICATION_UNKNOWN    0x00
  3712.   #define    APPLICATION_OCTETS    0x01
  3713. ! #define    APPLICATION_POSTSCRIPT    0x02
  3714.   
  3715.   
  3716.   static int  list_application (ct, toplevel)
  3717. ***************
  3718. *** 3551,3557 ****
  3719.   
  3720.   static struct k2v SubApplication[] = {
  3721.       "octet-stream",      APPLICATION_OCTETS,
  3722. -     "oda",          APPLICATION_ODA,
  3723.       "postscript",      APPLICATION_POSTSCRIPT,
  3724.       NULL,              APPLICATION_UNKNOWN    /* this one must be last! */
  3725.   };
  3726. --- 3762,3767 ----
  3727. ***************
  3728. *** 3570,3588 ****
  3729.       if (uleq (ci -> ci_subtype, kv -> kv_key))
  3730.           break;
  3731.   
  3732. !     if (autosw && !ct -> c_storeproc)
  3733. !     for (ap = ci -> ci_attrs, ep = ci -> ci_values; *ap; ap++, ep++)
  3734. !         if (uleq (*ap, "name")) {
  3735. !         register char   *cp;
  3736.   
  3737. !         if (*(cp = *ep) != '/'
  3738. !                 && *cp != '.'
  3739. !                 && *cp != '|'
  3740. !                 && *cp != '!'
  3741. !                 && !index (cp, '%'))
  3742. !             ct -> c_storeproc = add (cp, NULLCP);
  3743. !         break;
  3744. !         }
  3745.   
  3746.       if ((ct -> c_subtype = kv -> kv_value) == APPLICATION_OCTETS) {
  3747.       int    tarP,
  3748. --- 3780,3796 ----
  3749.       if (uleq (ci -> ci_subtype, kv -> kv_key))
  3750.           break;
  3751.   
  3752. !     for (ap = ci -> ci_attrs, ep = ci -> ci_values; *ap; ap++, ep++)
  3753. !     if (autosw && !ct -> c_storeproc && uleq (*ap, "x-name")) {
  3754. !         register char   *cp;
  3755.   
  3756. !         if (*(cp = *ep) != '/'
  3757. !             && *cp != '.'
  3758. !             && *cp != '|'
  3759. !             && *cp != '!'
  3760. !             && !index (cp, '%'))
  3761. !         ct -> c_storeproc = add (cp, NULLCP);
  3762. !     }
  3763.   
  3764.       if ((ct -> c_subtype = kv -> kv_value) == APPLICATION_OCTETS) {
  3765.       int    tarP,
  3766. ***************
  3767. *** 3598,3604 ****
  3768.           continue;
  3769.           }
  3770.   
  3771. !         if (uleq (*ap, "conversions")
  3772.               && (uleq (*ep, "compress") || uleq (*ep, "x-compress"))) {
  3773.           zP = 1;
  3774.           continue;
  3775. --- 3806,3812 ----
  3776.           continue;
  3777.           }
  3778.   
  3779. !         if ((uleq (*ap, "conversions") || uleq (*ap, "x-conversions"))
  3780.               && (uleq (*ep, "compress") || uleq (*ep, "x-compress"))) {
  3781.           zP = 1;
  3782.           continue;
  3783. ***************
  3784. *** 3625,3630 ****
  3785. --- 3833,3841 ----
  3786.   
  3787.   /*     ENCODINGS */
  3788.   
  3789. + #include "md5.c"
  3790.   struct cefile {
  3791.       char   *ce_file;
  3792.       int        ce_unlink;
  3793. ***************
  3794. *** 3773,3778 ****
  3795. --- 3984,3990 ----
  3796.   {
  3797.       int        bitno,
  3798.           cc,
  3799. +         digested,
  3800.           fd,
  3801.           len,
  3802.           skip;
  3803. ***************
  3804. *** 3786,3791 ****
  3805. --- 3998,4004 ----
  3806.              *b3 = &b[endian > 0 ? 3 : 0];
  3807.       char    buffer[BUFSIZ];
  3808.       register struct cefile *ce = (struct cefile *) ct -> c_ceparams;
  3809. +     MD5_CTX mdContext;
  3810.   
  3811.       if (ce -> ce_fp)
  3812.       goto ready_to_go;
  3813. ***************
  3814. *** 3817,3822 ****
  3815. --- 4030,4038 ----
  3816.       return NOTOK;
  3817.       }
  3818.       
  3819. +     if (digested = ct -> c_digested)
  3820. +     MD5Init (&mdContext);
  3821.       (void) lseek (fd = fileno (ct -> c_fp), ct -> c_begin, 0);
  3822.       bitno = 18, bits = 0L, skip = 0;
  3823.       while (len > 0)
  3824. ***************
  3825. *** 3856,3865 ****
  3826.   test_end: ;
  3827.                   if ((bitno -= 6) < 0) {
  3828.                   (void) putc ((char) *b1, ce -> ce_fp);
  3829.                   if (skip < 2) {
  3830.                       (void) putc ((char) *b2, ce -> ce_fp);
  3831. !                     if (skip < 1)
  3832.                       (void) putc ((char) *b3, ce -> ce_fp);
  3833.                   }
  3834.   
  3835.                   if (ferror (ce -> ce_fp)) {
  3836. --- 4072,4088 ----
  3837.   test_end: ;
  3838.                   if ((bitno -= 6) < 0) {
  3839.                   (void) putc ((char) *b1, ce -> ce_fp);
  3840. +                 if (digested)
  3841. +                     MD5Update (&mdContext, b1, 1);
  3842.                   if (skip < 2) {
  3843.                       (void) putc ((char) *b2, ce -> ce_fp);
  3844. !                     if (digested)
  3845. !                     MD5Update (&mdContext, b2, 1);
  3846. !                     if (skip < 1) {
  3847.                       (void) putc ((char) *b3, ce -> ce_fp);
  3848. +                     if (digested)
  3849. +                         MD5Update (&mdContext, b3, 1);
  3850. +                     }
  3851.                   }
  3852.   
  3853.                   if (ferror (ce -> ce_fp)) {
  3854. ***************
  3855. *** 3892,3897 ****
  3856. --- 4115,4133 ----
  3857.       goto clean_up;
  3858.       }
  3859.   
  3860. +     if (digested) {
  3861. +     unsigned char  digest[16];
  3862. +     MD5Final (digest, &mdContext);
  3863. +     if (bcmp ((char *) digest, (char *) ct -> c_digest,
  3864. +           sizeof digest / sizeof digest[0]))
  3865. +         content_error (NULLCP, ct,
  3866. +                "content integrity suspect (digest mismatch) -- continuing");
  3867. +     else
  3868. +         if (debugsw)
  3869. +         fprintf (stderr, "content integrity confirmed\n");
  3870. +     }
  3871.   ready_to_go: ;
  3872.       (void) fseek (ce -> ce_fp, 0L, 0);
  3873.       *file = ce -> ce_file;
  3874. ***************
  3875. *** 3954,3959 ****
  3876. --- 4190,4196 ----
  3877.   char  **file;
  3878.   {
  3879.       int        cc,
  3880. +         digested,
  3881.           len,
  3882.           quoted;
  3883.       register char  *cp,
  3884. ***************
  3885. *** 3961,3966 ****
  3886. --- 4198,4204 ----
  3887.       char    buffer[BUFSIZ];
  3888.       unsigned char mask;
  3889.       register struct cefile *ce = (struct cefile *) ct -> c_ceparams;
  3890. +     MD5_CTX mdContext;
  3891.   
  3892.       if (ce -> ce_fp)
  3893.       goto ready_to_go;
  3894. ***************
  3895. *** 3992,3997 ****
  3896. --- 4230,4238 ----
  3897.       return NOTOK;
  3898.       }
  3899.   
  3900. +     if (digested = ct -> c_digested)
  3901. +     MD5Init (&mdContext);
  3902.       (void) fseek (ct -> c_fp, ct -> c_begin, 0);
  3903.       quoted = 0;
  3904.   #ifdef    lint
  3905. ***************
  3906. *** 4025,4035 ****
  3907. --- 4266,4281 ----
  3908.               mask <<= 4;
  3909.               mask |= hex2nib[*cp & 0x7f];
  3910.               (void) putc (mask, ce -> ce_fp);
  3911. +             if (digested)
  3912. +             MD5Update (&mdContext, &mask, 1);
  3913.           }
  3914.           else
  3915.               switch (*cp) {
  3916.                   case ':':
  3917.                   (void) putc (*cp, ce -> ce_fp);
  3918. +                 if (digested)
  3919. +                 MD5Update (&mdContext, (unsigned char *) ":",
  3920. +                        1);
  3921.                   break;
  3922.   
  3923.               default:
  3924. ***************
  3925. *** 4066,4071 ****
  3926. --- 4312,4323 ----
  3927.           case '\t':
  3928.           case '\n':
  3929.               (void) putc (*cp, ce -> ce_fp);
  3930. +             if (digested) {
  3931. +             if (*cp == '\n')
  3932. +                 MD5Update (&mdContext, (unsigned char *) "\r\n",2);
  3933. +             else
  3934. +                 MD5Update (&mdContext, (unsigned char *) cp, 1);
  3935. +             }
  3936.               if (ferror (ce -> ce_fp)) {
  3937.               content_error (ce -> ce_file, ct, "error writing to");
  3938.               goto clean_up;
  3939. ***************
  3940. *** 4093,4098 ****
  3941. --- 4345,4363 ----
  3942.       goto clean_up;
  3943.       }
  3944.   
  3945. +     if (digested) {
  3946. +     unsigned char  digest[16];
  3947. +     MD5Final (digest, &mdContext);
  3948. +     if (bcmp ((char *) digest, (char *) ct -> c_digest,
  3949. +           sizeof digest / sizeof digest[0]))
  3950. +         content_error (NULLCP, ct,
  3951. +                "content integrity suspect (digest mismatch) -- continuing");
  3952. +     else
  3953. +         if (debugsw)
  3954. +         fprintf (stderr, "content integrity confirmed\n");
  3955. +     }
  3956.   ready_to_go: ;
  3957.       (void) fseek (ce -> ce_fp, 0L, 0);
  3958.       *file = ce -> ce_file;
  3959. ***************
  3960. *** 4206,4213 ****
  3961.   
  3962.   /*     External */
  3963.   
  3964. ! static int  openExternal (ct, ce, file, fd)
  3965.   register CT    ct;
  3966.   struct cefile *ce;
  3967.   char  **file;
  3968.   int    *fd;
  3969. --- 4471,4479 ----
  3970.   
  3971.   /*     External */
  3972.   
  3973. ! static int  openExternal (ct, cb, ce, file, fd)
  3974.   register CT    ct;
  3975. + CT    cb;
  3976.   struct cefile *ce;
  3977.   char  **file;
  3978.   int    *fd;
  3979. ***************
  3980. *** 4232,4242 ****
  3981.       }
  3982.   
  3983.       if (xpid) {
  3984.       (void) pidcheck (pidwait (xpid, NOTOK));
  3985.       xpid = 0;
  3986.       }
  3987.   
  3988. !     if (cache && (id = ct -> c_id)) {
  3989.       char    buffer[BUFSIZ];
  3990.   
  3991.       (void) sprintf (buffer, "%s/%s", cache, id = trimcpy (id));
  3992. --- 4498,4510 ----
  3993.       }
  3994.   
  3995.       if (xpid) {
  3996. +     if (xpid < 0)
  3997. +         xpid = -xpid;
  3998.       (void) pidcheck (pidwait (xpid, NOTOK));
  3999.       xpid = 0;
  4000.       }
  4001.   
  4002. !     if (cache && (id = cb -> c_id)) {
  4003.       char    buffer[BUFSIZ];
  4004.   
  4005.       (void) sprintf (buffer, "%s/%s", cache, id = trimcpy (id));
  4006. ***************
  4007. *** 4244,4257 ****
  4008.   
  4009.       id = getcpy (buffer);
  4010.       if (ce -> ce_fp = fopen (id, "r")) {
  4011.           struct stat    st;
  4012.   
  4013.           (void) fstat (fileno (ce -> ce_fp), &st);
  4014. !         (void) sprintf (buffer,
  4015. !                 "Use cached copy %s of size %lu octets (content %s)? ",
  4016. !                 id, (unsigned long) st.st_size,
  4017. !                 ct -> c_partno);
  4018.           if (getanswer (buffer)) {
  4019.           ce -> ce_unlink = 0;
  4020.           ce -> ce_file = id;
  4021.           goto ready_already;
  4022. --- 4512,4535 ----
  4023.   
  4024.       id = getcpy (buffer);
  4025.       if (ce -> ce_fp = fopen (id, "r")) {
  4026. +         char   *bp;
  4027.           struct stat    st;
  4028.   
  4029. +         if (cachesw == CACHE_ALWAYS)
  4030. +         goto do_cache;
  4031.           (void) fstat (fileno (ce -> ce_fp), &st);
  4032. !         (void) sprintf (bp = buffer,
  4033. !                 "Use cached copy %s of size %lu octets",
  4034. !                 id, (unsigned long) st.st_size);
  4035. !         bp += strlen (bp);
  4036. !         if (ct -> c_partno) {
  4037. !         (void) sprintf (bp, " (content %s)", ct -> c_partno);
  4038. !         bp += strlen (bp);
  4039. !         }
  4040. !         (void) sprintf (bp, "? ");
  4041.           if (getanswer (buffer)) {
  4042. + do_cache: ;
  4043.           ce -> ce_unlink = 0;
  4044.           ce -> ce_file = id;
  4045.           goto ready_already;
  4046. ***************
  4047. *** 4276,4282 ****
  4048.       register struct exbody *e = (struct exbody *) ct -> c_ctextern;
  4049.       register struct cefile *ce = (struct cefile *) ct -> c_ceparams;
  4050.   
  4051. !     switch (openExternal (e -> eb_parent, ce, file, &fd)) {
  4052.       case NOTOK:
  4053.           return NOTOK;
  4054.   
  4055. --- 4554,4560 ----
  4056.       register struct exbody *e = (struct exbody *) ct -> c_ctextern;
  4057.       register struct cefile *ce = (struct cefile *) ct -> c_ceparams;
  4058.   
  4059. !     switch (openExternal (e -> eb_parent, e -> eb_content, ce, file, &fd)) {
  4060.       case NOTOK:
  4061.           return NOTOK;
  4062.   
  4063. ***************
  4064. *** 4300,4306 ****
  4065.       }
  4066.   
  4067.       if (cache
  4068. !         && (id = e -> eb_parent -> c_id)
  4069.           && (!e -> eb_permission
  4070.               || !uleq (e -> eb_permission, "read-write"))) {
  4071.       char    buffer[BUFSIZ];
  4072. --- 4578,4584 ----
  4073.       }
  4074.   
  4075.       if (cache
  4076. !         && (id = e -> eb_content -> c_id)
  4077.           && (!e -> eb_permission
  4078.               || !uleq (e -> eb_permission, "read-write"))) {
  4079.       char    buffer[BUFSIZ];
  4080. ***************
  4081. *** 4307,4313 ****
  4082.   
  4083.       (void) sprintf (buffer, "Make cached, publically-accessible copy of %s? ",
  4084.               e -> eb_name);
  4085. !     if (getanswer (buffer)) {
  4086.           int        mask;
  4087.           char    cachefile[BUFSIZ];
  4088.           FILE   *fp;
  4089. --- 4585,4591 ----
  4090.   
  4091.       (void) sprintf (buffer, "Make cached, publically-accessible copy of %s? ",
  4092.               e -> eb_name);
  4093. !     if (cachesw == CACHE_ALWAYS || getanswer (buffer)) {
  4094.           int        mask;
  4095.           char    cachefile[BUFSIZ];
  4096.           FILE   *fp;
  4097. ***************
  4098. *** 4317,4328 ****
  4099.   
  4100.           mask = umask (0022);
  4101.           if (fp = fopen (cachefile, "w")) {
  4102.           register FILE   *gp = ce -> ce_fp;
  4103.   
  4104.           (void) fseek (gp, 0L, 0);
  4105.   
  4106. !         while (fgets (buffer, sizeof buffer - 1, gp))
  4107. !             (void) fputs (buffer, fp);
  4108.           (void) fflush (fp);
  4109.   
  4110.           if (ferror (gp)) {
  4111. --- 4595,4608 ----
  4112.   
  4113.           mask = umask (0022);
  4114.           if (fp = fopen (cachefile, "w")) {
  4115. +         int    cc;
  4116.           register FILE   *gp = ce -> ce_fp;
  4117.   
  4118.           (void) fseek (gp, 0L, 0);
  4119.   
  4120. !         while ((cc = fread (buffer, sizeof *buffer, sizeof buffer,
  4121. !                     gp)) > 0)
  4122. !             (void) fwrite (buffer, sizeof *buffer, cc, fp);
  4123.           (void) fflush (fp);
  4124.   
  4125.           if (ferror (gp)) {
  4126. ***************
  4127. *** 4371,4377 ****
  4128.       if (!ftp)
  4129.       return NOTOK;
  4130.   #endif
  4131. !     switch (openExternal (e -> eb_parent, ce, file, &fd)) {
  4132.       case NOTOK:
  4133.           return NOTOK;
  4134.   
  4135. --- 4651,4657 ----
  4136.       if (!ftp)
  4137.       return NOTOK;
  4138.   #endif
  4139. !     switch (openExternal (e -> eb_parent, e -> eb_content, ce, file, &fd)) {
  4140.       case NOTOK:
  4141.           return NOTOK;
  4142.   
  4143. ***************
  4144. *** 4409,4419 ****
  4145.   
  4146.       ce -> ce_unlink = *file == NULL, caching = 0, cachefile[0] = 0;
  4147.       if (cache
  4148. !         && (id = e -> eb_parent -> c_id)
  4149.           && (!e -> eb_permission
  4150.               || !uleq (e -> eb_permission, "read-write"))) {
  4151.       (void) sprintf (buffer, "Make cached, publically-accessible copy? ");
  4152. !     if (getanswer (buffer)) {
  4153.           (void) sprintf (cachefile, "%s/%s", cache, id = trimcpy (id));
  4154.           free (id);
  4155.   
  4156. --- 4689,4699 ----
  4157.   
  4158.       ce -> ce_unlink = *file == NULL, caching = 0, cachefile[0] = 0;
  4159.       if (cache
  4160. !         && (id = e -> eb_content -> c_id)
  4161.           && (!e -> eb_permission
  4162.               || !uleq (e -> eb_permission, "read-write"))) {
  4163.       (void) sprintf (buffer, "Make cached, publically-accessible copy? ");
  4164. !     if (cachesw == CACHE_ALWAYS || getanswer (buffer)) {
  4165.           (void) sprintf (cachefile, "%s/%s", cache, id = trimcpy (id));
  4166.           free (id);
  4167.   
  4168. ***************
  4169. *** 4549,4555 ****
  4170.       register struct exbody *e = (struct exbody *) ct -> c_ctextern;
  4171.       register struct cefile *ce = (struct cefile *) ct -> c_ceparams;
  4172.   
  4173. !     switch (openExternal (e -> eb_parent, ce, file, &fd)) {
  4174.       case NOTOK:
  4175.           return NOTOK;
  4176.   
  4177. --- 4829,4835 ----
  4178.       register struct exbody *e = (struct exbody *) ct -> c_ctextern;
  4179.       register struct cefile *ce = (struct cefile *) ct -> c_ceparams;
  4180.   
  4181. !     switch (openExternal (e -> eb_parent, e -> eb_content, ce, file, &fd)) {
  4182.       case NOTOK:
  4183.           return NOTOK;
  4184.   
  4185. ***************
  4186. *** 4566,4572 ****
  4187.       }
  4188.   
  4189.       bp = concat ("Retrieve content ", e -> eb_partno, " by asking mailbox ",
  4190. !          e -> eb_server, "\n\n", e -> eb_body, "\n? ", NULLCP);
  4191.       result = getanswer (bp);
  4192.       free (bp);
  4193.   
  4194. --- 4846,4854 ----
  4195.       }
  4196.   
  4197.       bp = concat ("Retrieve content ", e -> eb_partno, " by asking mailbox ",
  4198. !          e -> eb_server, "\n\n",
  4199. !          e -> eb_subject ? e -> eb_subject: e -> eb_body, "\n? ",
  4200. !          NULLCP);
  4201.       result = getanswer (bp);
  4202.       free (bp);
  4203.   
  4204. ***************
  4205. *** 4577,4594 ****
  4206.       vec[vecp++] = r1bindex (mailproc, '/');
  4207.       vec[vecp++] = e -> eb_server;
  4208.       vec[vecp++] = "-subject";
  4209. !     if (cache
  4210. !         && (id = e -> eb_parent -> c_id)
  4211. !         && (!e -> eb_permission
  4212. !             || !uleq (e -> eb_permission, "read-write"))) {
  4213. !     (void) sprintf (buffer, "cache content as %s/%s", cache,
  4214. !             id = trimcpy (id));
  4215. !     free (id);
  4216. !     vec[vecp++] = buffer;
  4217. !     }
  4218. !     else
  4219.       vec[vecp++] = "mail-server request";
  4220.       vec[vecp++] = "-body";
  4221.       vec[vecp++] = e -> eb_body;
  4222.       vec[vecp] = NULL;
  4223. --- 4859,4879 ----
  4224.       vec[vecp++] = r1bindex (mailproc, '/');
  4225.       vec[vecp++] = e -> eb_server;
  4226.       vec[vecp++] = "-subject";
  4227. !     if (e -> eb_subject)
  4228.       vec[vecp++] = "mail-server request";
  4229. +     else
  4230. +     if (cache
  4231. +             && (id = e -> eb_content -> c_id)
  4232. +             && (!e -> eb_permission
  4233. +                 || !uleq (e -> eb_permission, "read-write"))) {
  4234. +         (void) sprintf (buffer, "cache content as %s/%s", cache,
  4235. +                 id = trimcpy (id));
  4236. +         free (id);
  4237. +         vec[vecp++] = buffer;
  4238. +     }
  4239. +     else
  4240. +         vec[vecp++] = "mail-server request";
  4241.       vec[vecp++] = "-body";
  4242.       vec[vecp++] = e -> eb_body;
  4243.       vec[vecp] = NULL;
  4244. ***************
  4245. *** 5056,5062 ****
  4246.           }
  4247.   
  4248.           (void) sprintf (msgid, msgfmt, ++partno);
  4249. !         ct -> c_id = getcpy (msgid);
  4250.   
  4251.           return OK;
  4252.       }
  4253. --- 5341,5347 ----
  4254.           }
  4255.   
  4256.           (void) sprintf (msgid, msgfmt, ++partno);
  4257. !         p -> c_id = getcpy (msgid);
  4258.   
  4259.           return OK;
  4260.       }
  4261. ***************
  4262. *** 5223,5228 ****
  4263. --- 5508,5548 ----
  4264.   
  4265.   /*   */
  4266.   
  4267. + static char ebcdicsafe[0x100] = {
  4268. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4269. +     0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
  4270. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4271. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4272. +     0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01,
  4273. +     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
  4274. +     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
  4275. +     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
  4276. +     0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
  4277. +     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
  4278. +     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
  4279. +     0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
  4280. +     0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
  4281. +     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
  4282. +     0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
  4283. +     0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
  4284. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4285. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4286. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4287. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4288. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4289. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4290. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4291. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4292. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4293. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4294. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4295. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4296. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4297. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4298. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  4299. +     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  4300. + };
  4301.   static int  compose_content (ct)
  4302.   register CT    ct;
  4303.   {
  4304. ***************
  4305. *** 5422,5428 ****
  4306.           switch (ct -> c_type) {
  4307.               case CT_TEXT:
  4308.                   charset = ct -> c_ctparams ? 0 : -1;
  4309. !             linelen = 0;
  4310.               break;
  4311.   
  4312.               case CT_APPLICATION:
  4313. --- 5742,5748 ----
  4314.           switch (ct -> c_type) {
  4315.               case CT_TEXT:
  4316.                   charset = ct -> c_ctparams ? 0 : -1;
  4317. !             linelen = ct -> c_subtype == TEXT_PLAIN ? 0 : -1;
  4318.               break;
  4319.   
  4320.               case CT_APPLICATION:
  4321. ***************
  4322. *** 5435,5445 ****
  4323.           }
  4324.           while (fgets (buffer, sizeof buffer - 1, in)) {
  4325.               if (charset == -1) {
  4326. !             for (cp = buffer; *cp; cp++)
  4327.                   if (!isascii (*cp)) {
  4328.                   charset = CHARSET_UNKNOWN;
  4329.                   break;
  4330.                   }
  4331.               if ((linelen == -1) && (cp - buffer > CPERLIN + 1))
  4332.                   linelen = 1;
  4333.               if (result == NOTOK)
  4334. --- 5755,5770 ----
  4335.           }
  4336.           while (fgets (buffer, sizeof buffer - 1, in)) {
  4337.               if (charset == -1) {
  4338. !             for (cp = buffer; *cp; cp++) {
  4339.                   if (!isascii (*cp)) {
  4340.                   charset = CHARSET_UNKNOWN;
  4341.                   break;
  4342.                   }
  4343. +                 if (linelen == -1
  4344. +                     && ebcdicsw
  4345. +                     && !ebcdicsafe[*cp & 0xff])
  4346. +                 linelen = 1;
  4347. +             }
  4348.               if ((linelen == -1) && (cp - buffer > CPERLIN + 1))
  4349.                   linelen = 1;
  4350.               if (result == NOTOK)
  4351. ***************
  4352. *** 5451,5456 ****
  4353. --- 5776,5786 ----
  4354.               if (result == NOTOK)
  4355.               continue;
  4356.   
  4357. +             if (linelen == -1
  4358. +                 && (cp = buffer + strlen (buffer) - 2) > buffer
  4359. +                 && isspace (*cp))
  4360. +             linelen = 1;
  4361.               if (buffer[0] == '-' && buffer[1] == '-') {
  4362.               for (cp = buffer + strlen (buffer) - 1;
  4363.                        cp >= buffer;
  4364. ***************
  4365. *** 5507,5512 ****
  4366. --- 5837,5844 ----
  4367.               *cp++ = '\0';
  4368.               *ep = cp;
  4369.           }
  4370. +         if (ct -> c_type == CT_TEXT && ct -> c_subtype != TEXT_PLAIN)
  4371. +             ct -> c_encoding = linelen == -1 ? CE_7BIT : CE_QUOTED;
  4372.   
  4373.           (void) fclose (in);
  4374.   
  4375. ***************
  4376. *** 5620,5635 ****
  4377.           break;
  4378.   
  4379.       case CT_TEXT:
  4380. !         if (ct -> c_subtype != TEXT_PLAIN
  4381. !             || (ct -> c_ctparams
  4382.                   && ((struct text *) ct -> c_ctparams) -> tx_charset
  4383. !                     != CHARSET_USASCII)) {
  4384.   quoted_printable: ;
  4385.           fprintf (out, "%s: %s\n\n", ENCODING_FIELD,
  4386.                "quoted-printable");
  4387.           (void) writeQuoted (ct, out);
  4388.           break;
  4389.           }
  4390.           /* else fall... */
  4391.   
  4392.       case CT_MESSAGE:
  4393. --- 5952,5972 ----
  4394.           break;
  4395.   
  4396.       case CT_TEXT:
  4397. !         if (ct -> c_ctparams
  4398.                   && ((struct text *) ct -> c_ctparams) -> tx_charset
  4399. !                     != CHARSET_USASCII) {
  4400.   quoted_printable: ;
  4401. +         if (checksw)
  4402. +             writeDigest (ct, out, 1);
  4403.           fprintf (out, "%s: %s\n\n", ENCODING_FIELD,
  4404.                "quoted-printable");
  4405.           (void) writeQuoted (ct, out);
  4406.           break;
  4407.           }
  4408. +         if (ct -> c_subtype != TEXT_PLAIN && ct -> c_encoding != CE_7BIT)
  4409. +         goto quoted_printable;
  4410. +         if (checksw)
  4411. +         goto quoted_printable;
  4412.           /* else fall... */
  4413.   
  4414.       case CT_MESSAGE:
  4415. ***************
  4416. *** 5656,5661 ****
  4417. --- 5993,6000 ----
  4418.           /* else fall... */
  4419.   
  4420.       default:
  4421. +         if (checksw)
  4422. +         writeDigest (ct, out, 0);
  4423.           fprintf (out, "%s: %s\n\n", ENCODING_FIELD, "base64");
  4424.           (void) writeBase64 (ct, out);
  4425.           break;
  4426. ***************
  4427. *** 5730,5756 ****
  4428.               n++;
  4429.               break;
  4430.   
  4431. !         case '@':
  4432. !         case '`':
  4433. !             if (ebcdicsw)
  4434.               goto three_print;
  4435. - one_print: ;
  4436.               (void) putc (*cp, out);
  4437.               n++;
  4438.               break;
  4439.   
  4440. -         default:
  4441. -             if (('!' <= *cp && *cp <= '$')
  4442. -                 || ('[' <= *cp && *cp <= '^')
  4443. -                 || ('{' <= *cp && *cp <= '~')) {
  4444. -             if (ebcdicsw)
  4445. -                 goto three_print;
  4446. -             goto one_print;
  4447. -             }
  4448. -             if ('%' <= *cp && *cp <= 'z')
  4449. -             goto one_print;
  4450. -             /* else fall... */
  4451.           case '=':
  4452.   three_print: ;
  4453.               (void) fprintf (out, "=%02X", *cp & 0xff);
  4454. --- 6069,6081 ----
  4455.               n++;
  4456.               break;
  4457.   
  4458. !         default:
  4459. !             if (ebcdicsw && !ebcdicsafe[*cp & 0xff])
  4460.               goto three_print;
  4461.               (void) putc (*cp, out);
  4462.               n++;
  4463.               break;
  4464.   
  4465.           case '=':
  4466.   three_print: ;
  4467.               (void) fprintf (out, "=%02X", *cp & 0xff);
  4468. ***************
  4469. *** 5776,5782 ****
  4470.   
  4471.   /*   */
  4472.   
  4473. ! static char nib2b64[0x40f] =
  4474.       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  4475.   
  4476.   
  4477. --- 6101,6107 ----
  4478.   
  4479.   /*   */
  4480.   
  4481. ! static char nib2b64[0x40+1] =
  4482.       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  4483.   
  4484.   
  4485. ***************
  4486. *** 5847,5852 ****
  4487. --- 6172,6337 ----
  4488.       return OK;
  4489.   }
  4490.   
  4491. + /*   */
  4492. + static int  writeDigest (ct, out, asciiP)
  4493. + register CT    ct;
  4494. + FILE   *out;
  4495. + int    asciiP;
  4496. + {
  4497. +     int        cc;
  4498. +     char    buffer[BUFSIZ];
  4499. +     register unsigned char *dp;
  4500. +     unsigned char  digest[16];
  4501. +     FILE   *in;
  4502. +     MD5_CTX mdContext;
  4503. +     if ((in = fopen (ct -> c_file, "r")) == NULL)
  4504. +     adios (ct -> c_file, "unable to open for reading");
  4505. +     MD5Init (&mdContext);
  4506. +     if (asciiP) {
  4507. +     while (fgets (buffer, sizeof buffer - 1, in)) {
  4508. +         register char *cp;
  4509. +         char    c;
  4510. +         cp = buffer + strlen (buffer) - 1;
  4511. +         if ((c = *cp) == '\n')
  4512. +         *cp = '\0';
  4513. +         MD5Update (&mdContext, (unsigned char *) buffer,
  4514. +                (unsigned int) strlen (buffer));
  4515. +         if (c == '\n')
  4516. +         MD5Update (&mdContext, (unsigned char *) "\r\n", 2);
  4517. +     }
  4518. +     }
  4519. +     else
  4520. +     while ((cc = fread (buffer, sizeof *buffer, sizeof buffer, in)) > 0)
  4521. +         MD5Update (&mdContext, (unsigned char *) buffer,
  4522. +                (unsigned int) cc);
  4523. +     MD5Final (digest, &mdContext);
  4524. +     if (debugsw) {
  4525. +     unsigned char *ep;
  4526. +     fprintf (stderr, "MD5 digest=");
  4527. +     for (ep = (dp = digest) + sizeof digest / sizeof digest[0];
  4528. +              dp < ep;
  4529. +              dp++)
  4530. +         fprintf (stderr, "%02x", *dp & 0xff);
  4531. +     fprintf (stderr, "\n");
  4532. +     }
  4533. +     (void) fclose (in);
  4534. +     fprintf (out, "%s: ", MD5_FIELD);
  4535. +     for (dp = digest, cc = sizeof digest / sizeof digest[0]; cc > 0; cc -= 3) {
  4536. +     unsigned long bits;
  4537. +     register char *bp;
  4538. +     char outbuf[4];
  4539. +     bits = (*dp++ & 0xff) << 16;
  4540. +     if (cc > 1) {
  4541. +         bits |= (*dp++ & 0xff) << 8;
  4542. +         if (cc > 2)
  4543. +         bits |= *dp++ & 0xff;
  4544. +     }
  4545. +     for (bp = outbuf + sizeof outbuf; bp > outbuf; bits >>= 6)
  4546. +         *--bp = nib2b64[bits & 0x3f];
  4547. +     if (cc < 3) {
  4548. +         outbuf[3] = '=';
  4549. +         if (cc < 2)
  4550. +         outbuf[2] = '=';
  4551. +     }
  4552. +         (void) fwrite (outbuf, sizeof *outbuf, sizeof outbuf, out);
  4553. +     }
  4554. +     fprintf (out, "\n");
  4555. + }
  4556. + /*   */
  4557. + static int  readDigest (ct, cp)
  4558. + register CT    ct;
  4559. + register char *cp;
  4560. + {
  4561. +     int        bitno,
  4562. +         skip;
  4563. +     unsigned long    bits;
  4564. +     char   *bp = cp;
  4565. +     register unsigned char *dp;
  4566. +     unsigned char   value,
  4567. +                    *ep,
  4568. +            *b = (unsigned char *) &bits,
  4569. +            *b1 = &b[endian > 0 ? 1 : 2],
  4570. +            *b2 = &b[endian > 0 ? 2 : 1],
  4571. +            *b3 = &b[endian > 0 ? 3 : 0];
  4572. +     bitno = 18, bits = 0L, skip = 0;
  4573. +     for (ep = (dp = ct -> c_digest)
  4574. +              + sizeof ct -> c_digest / sizeof ct -> c_digest[0];
  4575. +          *cp;
  4576. +          cp++)
  4577. +     switch (*cp) {
  4578. +         default:
  4579. +             if (skip
  4580. +                 || (*cp & 0x80)
  4581. +                 || (value = b642nib[*cp & 0x7f]) > 0x3f) {
  4582. +             if (debugsw)
  4583. +             fprintf (stderr, "invalid BASE64 encoding\n");
  4584. +             return NOTOK;
  4585. +         }
  4586. +         bits |= value << bitno;
  4587. + test_end: ;
  4588. +         if ((bitno -= 6) < 0) {
  4589. +             if (dp + (3 - skip) > ep)
  4590. +             goto invalid_digest;
  4591. +             *dp++ = *b1;
  4592. +             if (skip < 2) {
  4593. +             *dp++ = *b2;
  4594. +             if (skip < 1)
  4595. +                 *dp++ = *b3;
  4596. +             }
  4597. +             bitno = 18, bits = 0L, skip = 0;
  4598. +         }
  4599. +         break;
  4600. +         case '=':
  4601. +         if (++skip > 3)
  4602. +             goto self_delimiting;
  4603. +         goto test_end;
  4604. +     }
  4605. +     if (bitno != 18) {
  4606. +     if (debugsw)
  4607. +         fprintf (stderr, "premature ending (bitno %d)\n", bitno);
  4608. +     return NOTOK;
  4609. +     }
  4610. + self_delimiting: ;
  4611. +     if (dp != ep) {
  4612. + invalid_digest: ;
  4613. +     if (debugsw) {
  4614. +         while (*cp)
  4615. +         cp++;
  4616. +         fprintf (stderr, "invalid MD5 digest (got %d octets)\n",
  4617. +              cp - bp);
  4618. +     }
  4619. +     return NOTOK;
  4620. +     }
  4621. +     if (debugsw) {
  4622. +     fprintf (stderr, "MD5 digest=");
  4623. +     for (dp = ct -> c_digest; dp < ep; dp++)
  4624. +         fprintf (stderr, "%02x", *dp & 0xff);
  4625. +     fprintf (stderr, "\n");
  4626. +     }
  4627. +     return OK;
  4628. + }
  4629.   /*     VIAMAIL */
  4630.   
  4631.   #include "../zotnet/tws.h"
  4632. ***************
  4633. *** 5865,5870 ****
  4634. --- 6350,6356 ----
  4635.           nparts,
  4636.           status;
  4637.       long    pos;
  4638. +     long    offset;
  4639.       char    tmpfil[BUFSIZ];
  4640.       struct stat st;
  4641.       FILE   *fp;
  4642. ***************
  4643. *** 5888,5893 ****
  4644. --- 6374,6380 ----
  4645.       fprintf (fp, "From: %s\n", fromsw), nlines++;
  4646.       }
  4647.       fprintf (fp, "%s: %s\n", VRSN_FIELD, VRSN_VALUE), nlines++;
  4648. +     offset = ftell (fp);
  4649.       fprintf (fp, "%s: application/octet-stream", TYPE_FIELD);
  4650.       if (parmsw)
  4651.       fprintf (fp, "; %s", parmsw);
  4652. ***************
  4653. *** 5910,5922 ****
  4654.       nparts = (nlines + (LPERMSG - 1)) / LPERMSG;
  4655.   
  4656.       if (nparts <= 1)
  4657. !     status = via_post (tmpfil);
  4658.       else {
  4659.       int    partno;
  4660.       long    clock;
  4661.       char    buffer[BUFSIZ],
  4662.           msgid[BUFSIZ];
  4663. !     
  4664.       if (verbosw) {
  4665.           printf ("sending binary image as %d partial messages\n", nparts);
  4666.           (void) fflush (stdout);
  4667. --- 6397,6409 ----
  4668.       nparts = (nlines + (LPERMSG - 1)) / LPERMSG;
  4669.   
  4670.       if (nparts <= 1)
  4671. !     status = via_post (tmpfil, 0);
  4672.       else {
  4673.       int    partno;
  4674.       long    clock;
  4675.       char    buffer[BUFSIZ],
  4676.           msgid[BUFSIZ];
  4677.       if (verbosw) {
  4678.           printf ("sending binary image as %d partial messages\n", nparts);
  4679.           (void) fflush (stdout);
  4680. ***************
  4681. *** 5925,5935 ****
  4682.       (void) time (&clock);
  4683.       (void) sprintf (msgid, "<%d.%ld@%s>", getpid (), clock, LocalName ());
  4684.   
  4685. !     (void) fseek (fp, 0L, 0);
  4686. !     if (!fgets (buffer, sizeof buffer, fp)
  4687. !             || !fgets (buffer, sizeof buffer, fp)
  4688. !             || (subjsw && !fgets (buffer, sizeof buffer, fp)))
  4689. !         adios (NULLCP, "premature eof");
  4690.       for (partno = 1; partno <= nparts; partno++) {
  4691.           int        lineno;
  4692.           char    tmpdrf[BUFSIZ];
  4693. --- 6412,6418 ----
  4694.       (void) time (&clock);
  4695.       (void) sprintf (msgid, "<%d.%ld@%s>", getpid (), clock, LocalName ());
  4696.   
  4697. !     (void) fseek (fp, offset, 0);
  4698.       for (partno = 1; partno <= nparts; partno++) {
  4699.           int        lineno;
  4700.           char    tmpdrf[BUFSIZ];
  4701. ***************
  4702. *** 5962,5967 ****
  4703. --- 6445,6451 ----
  4704.   
  4705.           (void) fputs (buffer, out);
  4706.           }
  4707. +         offset = ftell (fp);
  4708.   
  4709.           if (fflush (out))
  4710.           adios (tmpdrf, "error writing to");
  4711. ***************
  4712. *** 5968,5987 ****
  4713.   
  4714.           (void) fclose (out);
  4715.   
  4716. !         if (slowsw > 0 && 1 < partno && partno < nparts) {
  4717.           if (verbosw) {
  4718.               printf ("pausing %d seconds before sending part %d...\n",
  4719. !                 slowsw, partno);
  4720.               (void) fflush (stdout);
  4721.           }
  4722.   
  4723.           sleep ((unsigned) slowsw);
  4724.           }
  4725. -         status = via_post (tmpdrf);
  4726. -         (void) unlink (tmpdrf);
  4727. -         if (status)
  4728. -         break;
  4729.       }
  4730.       }
  4731.   
  4732. --- 6452,6471 ----
  4733.   
  4734.           (void) fclose (out);
  4735.   
  4736. !         status = via_post (tmpdrf, slowsw == 0);
  4737. !         (void) unlink (tmpdrf);
  4738. !         if (status)
  4739. !         break;
  4740. !         if (slowsw > 0 && partno < nparts) {
  4741.           if (verbosw) {
  4742.               printf ("pausing %d seconds before sending part %d...\n",
  4743. !                 slowsw, partno + 1);
  4744.               (void) fflush (stdout);
  4745.           }
  4746.   
  4747.           sleep ((unsigned) slowsw);
  4748.           }
  4749.       }
  4750.       }
  4751.   
  4752. ***************
  4753. *** 5993,6000 ****
  4754.   
  4755.   /*   */
  4756.   
  4757. ! static int  via_post (file)
  4758.   char   *file;
  4759.   {
  4760.       int        child_id,
  4761.           i;
  4762. --- 6477,6485 ----
  4763.   
  4764.   /*   */
  4765.   
  4766. ! static int  via_post (file, queued)
  4767.   char   *file;
  4768. + int    queued;
  4769.   {
  4770.       int        child_id,
  4771.           i;
  4772. ***************
  4773. *** 6007,6013 ****
  4774.           /* NOTREACHED */
  4775.   
  4776.       case OK:
  4777. !         (void) execlp (postproc, r1bindex (postproc, '/'), file, NULLCP);
  4778.           fprintf (stderr, "unable to exec ");
  4779.           perror (postproc);
  4780.           _exit (-1);
  4781. --- 6492,6499 ----
  4782.           /* NOTREACHED */
  4783.   
  4784.       case OK:
  4785. !         (void) execlp (postproc, r1bindex (postproc, '/'), file,
  4786. !                queued ? "-queued" : NULLCP, NULLCP);
  4787.           fprintf (stderr, "unable to exec ");
  4788.           perror (postproc);
  4789.           _exit (-1);
  4790. *** ../mh-6.8/uip/msgchk.c    Tue Dec 15 08:56:00 1992
  4791. --- uip/msgchk.c    Fri Aug 20 08:52:59 1993
  4792. ***************
  4793. *** 1,6 ****
  4794.   /* msgchk.c - check for mail */
  4795.   #ifndef    lint
  4796. ! static char ident[] = "@(#)$Id: msgchk.c,v 1.11 1992/12/15 00:20:22 jromine Exp $";
  4797.   #endif    /* lint */
  4798.   
  4799.   #include "../h/mh.h"
  4800. --- 1,6 ----
  4801.   /* msgchk.c - check for mail */
  4802.   #ifndef    lint
  4803. ! static char ident[] = "@(#)$Id: msgchk.c,v 1.12 1993/08/20 15:52:41 jromine Exp $";
  4804.   #endif    /* lint */
  4805.   
  4806.   #include "../h/mh.h"
  4807. ***************
  4808. *** 392,402 ****
  4809.               status;
  4810.       char   *pass;
  4811.   
  4812. !     if (rpop) {
  4813. !     if (user == NULL)
  4814. !         user = getusr ();
  4815.       pass = getusr ();
  4816. -     }
  4817.       else
  4818.       ruserpass (host, &user, &pass);
  4819.   
  4820. --- 392,401 ----
  4821.               status;
  4822.       char   *pass;
  4823.   
  4824. !     if (user == NULL)
  4825. !     user = getusr ();
  4826. !     if (rpop > 0)
  4827.       pass = getusr ();
  4828.       else
  4829.       ruserpass (host, &user, &pass);
  4830.   
  4831. *** ../mh-6.8/uip/post.c    Tue Dec 15 08:56:03 1992
  4832. --- uip/post.c    Fri Aug 20 08:53:39 1993
  4833. ***************
  4834. *** 1,6 ****
  4835.   /* post.c - enter messages into the transport system */
  4836.   #ifndef    lint
  4837. ! static char ident[] = "@(#)$Id: post.c,v 2.21 1992/12/15 00:20:22 jromine Exp $";
  4838.   #endif    /* lint */
  4839.   
  4840.   #include "../h/mh.h"
  4841. --- 1,6 ----
  4842.   /* post.c - enter messages into the transport system */
  4843.   #ifndef    lint
  4844. ! static char ident[] = "@(#)$Id: post.c,v 2.22 1993/08/20 15:53:20 jromine Exp $";
  4845.   #endif    /* lint */
  4846.   
  4847.   #include "../h/mh.h"
  4848. ***************
  4849. *** 149,154 ****
  4850. --- 149,157 ----
  4851.   #define    PARTSW    34
  4852.       "partno", -6,
  4853.   
  4854. + #define    QUEUESW 35
  4855. +     "queued", -6,
  4856.       NULL, 0
  4857.   };
  4858.   
  4859. ***************
  4860. *** 327,332 ****
  4861. --- 330,337 ----
  4862.   static char    *fill_in = NULLCP;
  4863.   static char    *partno = NULLCP;
  4864.   
  4865. + static    int    queued = 0;
  4866.   long    lseek (), time ();
  4867.   
  4868.   static    putfmt(), start_headers(), finish_headers(), putgrp(), pl();
  4869. ***************
  4870. *** 565,570 ****
  4871. --- 570,579 ----
  4872.               if (!(partno = *argp++) || *partno == '-')
  4873.               adios (NULLCP, "missing argument to %s", argp[-2]);
  4874.               continue;
  4875. +         case QUEUESW:
  4876. +             queued++;
  4877. +             continue;
  4878.           }
  4879.       if (msg)
  4880.           adios (NULLCP, "only one message at a time!");
  4881. ***************
  4882. *** 1403,1409 ****
  4883.   #endif    /* MMDFMTS */
  4884.   #ifdef    SENDMTS
  4885.       if (!whomsw || checksw)
  4886. !     if (rp_isbad (retval = sm_init (clientsw, serversw, 0, 0, snoop))
  4887.           || rp_isbad (retval = sm_winit (smtpmode, from)))
  4888.           die (NULLCP, "problem initializing server; %s",
  4889.               rp_string (retval));
  4890. --- 1412,1418 ----
  4891.   #endif    /* MMDFMTS */
  4892.   #ifdef    SENDMTS
  4893.       if (!whomsw || checksw)
  4894. !     if (rp_isbad (retval = sm_init (clientsw, serversw, 0, 0, snoop, 0, 0))
  4895.           || rp_isbad (retval = sm_winit (smtpmode, from)))
  4896.           die (NULLCP, "problem initializing server; %s",
  4897.               rp_string (retval));
  4898. ***************
  4899. *** 1476,1482 ****
  4900.   int     bccque,
  4901.           talk;
  4902.   {
  4903. !     int     fd;
  4904.   #ifndef    MHMTS
  4905.       int        retval;
  4906.   #ifdef    MMDFMTS
  4907. --- 1485,1492 ----
  4908.   int     bccque,
  4909.           talk;
  4910.   {
  4911. !     int     fd,
  4912. !             onex = !(msgflags & MINV) || bccque;
  4913.   #ifndef    MHMTS
  4914.       int        retval;
  4915.   #ifdef    MMDFMTS
  4916. ***************
  4917. *** 1511,1517 ****
  4918.   #endif    /* RP_NS */
  4919.   #endif    /* MMDFMTS */
  4920.   #ifdef    SENDMTS
  4921. !     if (rp_isbad (retval = sm_init (clientsw, serversw, watch, verbose, snoop))
  4922.           || rp_isbad (retval = sm_winit (smtpmode, from)))
  4923.       die (NULLCP, "problem initializing server; %s", rp_string (retval));
  4924.   #endif    /* SENDMTS */
  4925. --- 1521,1528 ----
  4926.   #endif    /* RP_NS */
  4927.   #endif    /* MMDFMTS */
  4928.   #ifdef    SENDMTS
  4929. !     if (rp_isbad (retval = sm_init (clientsw, serversw, watch, verbose, snoop,
  4930. !                     onex, queued))
  4931.           || rp_isbad (retval = sm_winit (smtpmode, from)))
  4932.       die (NULLCP, "problem initializing server; %s", rp_string (retval));
  4933.   #endif    /* SENDMTS */
  4934. ***************
  4935. *** 1541,1547 ****
  4936.       (void) mm_end (OK);
  4937.   #endif    /* MMDFMTS */
  4938.   #ifdef    SENDMTS
  4939. !     (void) sm_end (!(msgflags & MINV) || bccque ? OK : DONE);
  4940.   #endif    /* SENDMTS */
  4941.   
  4942.       sigoff ();
  4943. --- 1552,1558 ----
  4944.       (void) mm_end (OK);
  4945.   #endif    /* MMDFMTS */
  4946.   #ifdef    SENDMTS
  4947. !     (void) sm_end (onex ? OK : DONE);
  4948.   #endif    /* SENDMTS */
  4949.   
  4950.       sigoff ();
  4951. ***************
  4952. *** 1667,1673 ****
  4953.   #endif    /* RP_NS */
  4954.   #endif    /* MMDFMTS */
  4955.   #ifdef    SENDMTS
  4956. !     if (rp_isbad (retval = sm_init (clientsw, serversw, watch, verbose, snoop))
  4957.           || rp_isbad (retval = sm_winit (smtpmode, from)))
  4958.       die (NULLCP, "problem initializing server; %s", rp_string (retval));
  4959.   #endif    /* SENDMTS */
  4960. --- 1678,1685 ----
  4961.   #endif    /* RP_NS */
  4962.   #endif    /* MMDFMTS */
  4963.   #ifdef    SENDMTS
  4964. !     if (rp_isbad (retval = sm_init (clientsw, serversw, watch, verbose, snoop,
  4965. !                     0, 0))
  4966.           || rp_isbad (retval = sm_winit (smtpmode, from)))
  4967.       die (NULLCP, "problem initializing server; %s", rp_string (retval));
  4968.   #endif    /* SENDMTS */
  4969. *** ../mh-6.8/uip/replsbr.c    Tue Dec 15 08:56:04 1992
  4970. --- uip/replsbr.c    Fri Feb 26 13:59:31 1993
  4971. ***************
  4972. *** 1,6 ****
  4973.   /* replsbr.c - routines to help repl along... */
  4974.   #ifndef    lint
  4975. ! static char ident[] = "@(#)$Id: replsbr.c,v 1.13 1992/12/15 00:20:22 jromine Exp $";
  4976.   #endif    /* lint */
  4977.   
  4978.   #include "../h/mh.h"
  4979. --- 1,6 ----
  4980.   /* replsbr.c - routines to help repl along... */
  4981.   #ifndef    lint
  4982. ! static char ident[] = "@(#)$Id: replsbr.c,v 1.14 1993/02/26 21:59:28 jromine Exp $";
  4983.   #endif    /* lint */
  4984.   
  4985.   #include "../h/mh.h"
  4986. ***************
  4987. *** 422,427 ****
  4988. --- 422,431 ----
  4989.           (void) dup2 (fileno (out), fileno (stdout));
  4990.           closefds (3);
  4991.   
  4992. + #ifdef _FSTDIO
  4993. +         /* <sigh> the code assumed that rewind does this. */
  4994. +         lseek (fileno(stdin), 0, SEEK_SET);
  4995. + #endif
  4996.           execlp (mhlproc, mhl, "-form", filter, "-noclear", NULLCP);
  4997.           fprintf (stderr, "unable to exec ");
  4998.           perror (mhlproc);
  4999. *** ../mh-6.8/uip/sbboards.c    Tue Dec 15 08:56:05 1992
  5000. --- uip/sbboards.c    Fri Aug 20 08:53:59 1993
  5001. ***************
  5002. *** 4,10 ****
  5003.   /* spop.c - MH style mailer to write to a POP subscriber */
  5004.   #endif    SPOP
  5005.   #ifndef    lint
  5006. ! static char ident[] = "@(#)$Id: sbboards.c,v 1.6 1992/11/24 21:00:41 jromine Exp $";
  5007.   #endif    lint
  5008.   
  5009.   #ifndef    SPOP
  5010. --- 4,10 ----
  5011.   /* spop.c - MH style mailer to write to a POP subscriber */
  5012.   #endif    SPOP
  5013.   #ifndef    lint
  5014. ! static char ident[] = "@(#)$Id: sbboards.c,v 1.8 1993/08/20 15:53:49 jromine Exp $";
  5015.   #endif    lint
  5016.   
  5017.   #ifndef    SPOP
  5018. ***************
  5019. *** 109,114 ****
  5020. --- 109,123 ----
  5021.   #endif    /* SYS5 */
  5022.   #endif
  5023.   
  5024. + #ifndef    SPOP
  5025. + static int    mbx_init();
  5026. + #endif
  5027. + #ifdef    DISTRIBUTE
  5028. + static int     distribute(), notify(), encap(),
  5029. +         dst_init(), dst_text(),
  5030. +         dst_end(), dst_lose(), dst_adrs();
  5031. + #endif
  5032.   /* hack */
  5033.   #define    adios    my_adios
  5034.   static    localmail(), arginit();
  5035. ***************
  5036. *** 248,254 ****
  5037.   {
  5038.       int     retval;
  5039.   
  5040. !     if (rp_isbad (retval = sm_init (NULLCP, NULLCP, 0, 0, 0))
  5041.           || rp_isbad (retval = sm_winit (S_MAIL, bb_from)))
  5042.       return lose ("problem initializing SendMail; %s",
  5043.           rp_string (retval));
  5044. --- 257,263 ----
  5045.   {
  5046.       int     retval;
  5047.   
  5048. !     if (rp_isbad (retval = sm_init (NULLCP, NULLCP, 0, 0, 0, 0, 0))
  5049.           || rp_isbad (retval = sm_winit (S_MAIL, bb_from)))
  5050.       return lose ("problem initializing SendMail; %s",
  5051.           rp_string (retval));
  5052. ***************
  5053. *** 380,386 ****
  5054.       if (bb_fderr == NOTOK)
  5055.       return;
  5056.   
  5057. !     if (rp_isbad (sm_init (NULLCP, NULLCP, 0, 0, 0))
  5058.           || rp_isbad (sm_winit (S_MAIL, bb_from)))
  5059.       goto sm_err;
  5060.   
  5061. --- 389,395 ----
  5062.       if (bb_fderr == NOTOK)
  5063.       return;
  5064.   
  5065. !     if (rp_isbad (sm_init (NULLCP, NULLCP, 0, 0, 0, 0, 0))
  5066.           || rp_isbad (sm_winit (S_MAIL, bb_from)))
  5067.       goto sm_err;
  5068.   
  5069. *** ../mh-6.8/uip/scansbr.c    Tue Dec 15 08:56:05 1992
  5070. --- uip/scansbr.c    Fri Aug 20 08:54:16 1993
  5071. ***************
  5072. *** 1,6 ****
  5073.   /* scansbr.c - routines to help scan along... */
  5074.   #ifndef    lint
  5075. ! static char ident[] = "@(#)$Id: scansbr.c,v 1.13 1992/12/15 00:20:22 jromine Exp $";
  5076.   #endif    /* lint */
  5077.   
  5078.   #include "../h/mh.h"
  5079. --- 1,6 ----
  5080.   /* scansbr.c - routines to help scan along... */
  5081.   #ifndef    lint
  5082. ! static char ident[] = "@(#)$Id: scansbr.c,v 1.15 1993/08/20 15:54:08 jromine Exp $";
  5083.   #endif    /* lint */
  5084.   
  5085.   #include "../h/mh.h"
  5086. ***************
  5087. *** 13,18 ****
  5088. --- 13,22 ----
  5089.   #include <sys/types.h>
  5090.   #include <sys/stat.h>
  5091.   
  5092. + #ifdef _FSTDIO
  5093. + #define       _ptr    _p              /* Gag */
  5094. + #define       _cnt    _w              /* Wretch */
  5095. + #endif
  5096.   
  5097.   #define MAXSCANL 256        /* longest possible scan line */
  5098.   #define SBUFSIZ 512        /* buffer size for content part of header
  5099. ***************
  5100. *** 81,90 ****
  5101.       char    *scnmsg;
  5102.       FILE    *scnout;
  5103.       char    name[NAMESZ];
  5104. !     static  int slwidth;
  5105.   
  5106.       /* first-time only initialization */
  5107.       if (scanl == NULLCP) {
  5108.       if (width == 0) {
  5109.           if ((width = sc_width ()) < WIDTH/2)
  5110.           width = WIDTH/2;
  5111. --- 85,97 ----
  5112.       char    *scnmsg;
  5113.       FILE    *scnout;
  5114.       char    name[NAMESZ];
  5115. !     static  int rlwidth,
  5116. !             slwidth;
  5117.   
  5118.       /* first-time only initialization */
  5119.       if (scanl == NULLCP) {
  5120. +     int    bigwid;
  5121.       if (width == 0) {
  5122.           if ((width = sc_width ()) < WIDTH/2)
  5123.           width = WIDTH/2;
  5124. ***************
  5125. *** 126,133 ****
  5126.       if (used_buf == NULL)
  5127.           adios (NULLCP, "unable to allocate component buffer stack");
  5128.       used_buf += ncomps+1; *--used_buf = 0;
  5129.       for (i = ncomps; i--; )
  5130. !         if ((*nxtbuf++ = malloc( SBUFSIZ )) == NULL)
  5131.           adios (NULLCP, "unable to allocate component buffer");
  5132.       }
  5133.       /* each-message initialization */
  5134. --- 133,141 ----
  5135.       if (used_buf == NULL)
  5136.           adios (NULLCP, "unable to allocate component buffer stack");
  5137.       used_buf += ncomps+1; *--used_buf = 0;
  5138. +     rlwidth = bodycomp && (width > SBUFSIZ) ? width : SBUFSIZ;
  5139.       for (i = ncomps; i--; )
  5140. !         if ((*nxtbuf++ = malloc( rlwidth )) == NULL)
  5141.           adios (NULLCP, "unable to allocate component buffer");
  5142.       }
  5143.       /* each-message initialization */
  5144. ***************
  5145. *** 142,148 ****
  5146.        * get the first field.  If the msg is non-empty and we're doing
  5147.        * an "inc", open the output file.
  5148.        */
  5149. !     if ((state = m_getfld (FLD, name, tmpbuf, SBUFSIZ, inb)) == FILEEOF)
  5150.       if (ferror(inb)) {
  5151.           advise("read", "unable to"); /* "read error" */
  5152.           return SCNFAT;
  5153. --- 150,156 ----
  5154.        * get the first field.  If the msg is non-empty and we're doing
  5155.        * an "inc", open the output file.
  5156.        */
  5157. !     if ((state = m_getfld (FLD, name, tmpbuf, rlwidth, inb)) == FILEEOF)
  5158.       if (ferror(inb)) {
  5159.           advise("read", "unable to"); /* "read error" */
  5160.           return SCNFAT;
  5161. ***************
  5162. *** 168,174 ****
  5163.       }
  5164.   
  5165.       /* scan - main loop */
  5166. !     for (compnum = 1; ; state = m_getfld (state, name, tmpbuf, SBUFSIZ, inb)) {
  5167.       switch (state) {
  5168.           case FLD: 
  5169.           case FLDPLUS: 
  5170. --- 176,182 ----
  5171.       }
  5172.   
  5173.       /* scan - main loop */
  5174. !     for (compnum = 1; ; state = m_getfld (state, name, tmpbuf, rlwidth, inb)) {
  5175.       switch (state) {
  5176.           case FLD: 
  5177.           case FLDPLUS: 
  5178. ***************
  5179. *** 203,209 ****
  5180.               } while (cptr = cptr->c_next);
  5181.   
  5182.           while (state == FLDPLUS) {
  5183. !             state = m_getfld (state, name, tmpbuf, SBUFSIZ, inb);
  5184.               if (outnum)
  5185.               FPUTS (tmpbuf);
  5186.           }
  5187. --- 211,217 ----
  5188.               } while (cptr = cptr->c_next);
  5189.   
  5190.           while (state == FLDPLUS) {
  5191. !             state = m_getfld (state, name, tmpbuf, rlwidth, inb);
  5192.               if (outnum)
  5193.               FPUTS (tmpbuf);
  5194.           }
  5195. *** ../mh-6.8/uip/sendsbr.c    Tue Dec 15 08:56:06 1992
  5196. --- uip/sendsbr.c    Fri Aug 20 08:55:15 1993
  5197. ***************
  5198. *** 1,6 ****
  5199.   /* sendsbr.c - routines to help WhatNow/Send along */
  5200.   #ifndef    lint
  5201. ! static char ident[] = "@(#)$Id: sendsbr.c,v 2.12 1992/12/15 00:20:22 jromine Exp $";
  5202.   #endif    /* lint */
  5203.   
  5204.   #include "../h/mh.h"
  5205. --- 1,6 ----
  5206.   /* sendsbr.c - routines to help WhatNow/Send along */
  5207.   #ifndef    lint
  5208. ! static char ident[] = "@(#)$Id: sendsbr.c,v 2.13 1993/08/20 15:54:44 jromine Exp $";
  5209.   #endif    /* lint */
  5210.   
  5211.   #include "../h/mh.h"
  5212. ***************
  5213. *** 99,112 ****
  5214.           || distfile
  5215.           || stat (drft, &sts) == NOTOK
  5216.           || sts.st_size < CPERMSG) {
  5217.       splitsw = -1;
  5218.       return sendaux2 (vec, vecp, drft, st);
  5219.       }
  5220. -     status = OK;
  5221.   
  5222. -     vec[vecp++] = "-partno";
  5223. -     vec[vecp++] = partnum;
  5224.       if ((in = fopen (drft, "r")) == NULL)
  5225.       adios (drft, "unable to open for reading");
  5226.   
  5227. --- 99,109 ----
  5228.           || distfile
  5229.           || stat (drft, &sts) == NOTOK
  5230.           || sts.st_size < CPERMSG) {
  5231. + one_shot: ;
  5232.       splitsw = -1;
  5233.       return sendaux2 (vec, vecp, drft, st);
  5234.       }
  5235.   
  5236.       if ((in = fopen (drft, "r")) == NULL)
  5237.       adios (drft, "unable to open for reading");
  5238.   
  5239. ***************
  5240. *** 119,125 ****
  5241.           case FLDEOF:
  5242.               compnum++;
  5243.   
  5244. !         if (uleq (name, VRSN_FIELD) || uleq (name, "Message-ID")) {
  5245.               while (state == FLDPLUS)
  5246.               state = m_getfld (state, name, buffer, sizeof buffer,
  5247.                         in);
  5248. --- 116,124 ----
  5249.           case FLDEOF:
  5250.               compnum++;
  5251.   
  5252. !         if (uleq (name, VRSN_FIELD)
  5253. !                 || uleq (name, "Encrypted")
  5254. !                 || uleq (name, "Message-ID")) {
  5255.               while (state == FLDPLUS)
  5256.               state = m_getfld (state, name, buffer, sizeof buffer,
  5257.                         in);
  5258. ***************
  5259. *** 162,167 ****
  5260. --- 161,168 ----
  5261.   
  5262.       break;
  5263.       }
  5264. +     if (cp == NULL)
  5265. +     adios (NULLCP, "headers missing from draft");
  5266.   
  5267.       nparts = 1, pos = start;
  5268.       while (fgets (buffer, sizeof buffer - 1, in)) {
  5269. ***************
  5270. *** 170,179 ****
  5271. --- 171,196 ----
  5272.       if ((pos += (len = strlen (buffer))) > CPERMSG)
  5273.           nparts++, pos = len;
  5274.       }
  5275. +     if (nparts == 1) {
  5276. +     free (cp);
  5277. +     if (dp)
  5278. +         free (dp);
  5279. +     (void) fclose (in);
  5280. +     goto one_shot;
  5281. +     }
  5282.       if (!pushsw) {
  5283.       printf ("Sending as %d Partial Messages\n", nparts);
  5284.       (void) fflush (stdout);
  5285.       }
  5286. +     status = OK;
  5287. +     vec[vecp++] = "-partno";
  5288. +     vec[vecp++] = partnum;
  5289. +     if (splitsw == 0)
  5290. +     vec[vecp++] = "-queued";
  5291.   
  5292.       (void) time (&clock);
  5293.       (void) sprintf (msgid, "<%d.%ld@%s>", getpid (), clock, LocalName ());
  5294. *** ../mh-6.8/uip/spop.c    Tue Dec 15 08:56:07 1992
  5295. --- uip/spop.c    Fri Aug 20 08:55:28 1993
  5296. ***************
  5297. *** 4,10 ****
  5298.   /* spop.c - MH style mailer to write to a POP subscriber */
  5299.   #endif    SPOP
  5300.   #ifndef    lint
  5301. ! static char ident[] = "@(#)$Id: spop.c,v 1.6 1992/11/04 01:04:35 jromine Exp $";
  5302.   #endif    lint
  5303.   
  5304.   #ifndef    SPOP
  5305. --- 4,10 ----
  5306.   /* spop.c - MH style mailer to write to a POP subscriber */
  5307.   #endif    SPOP
  5308.   #ifndef    lint
  5309. ! static char ident[] = "@(#)$Id: spop.c,v 1.7 1993/08/20 15:55:23 jromine Exp $";
  5310.   #endif    lint
  5311.   
  5312.   #ifndef    SPOP
  5313. ***************
  5314. *** 248,254 ****
  5315.   {
  5316.       int     retval;
  5317.   
  5318. !     if (rp_isbad (retval = sm_init (NULLCP, NULLCP, 0, 0, 0))
  5319.           || rp_isbad (retval = sm_winit (S_MAIL, bb_from)))
  5320.       return lose ("problem initializing SendMail; %s",
  5321.           rp_string (retval));
  5322. --- 248,254 ----
  5323.   {
  5324.       int     retval;
  5325.   
  5326. !     if (rp_isbad (retval = sm_init (NULLCP, NULLCP, 0, 0, 0, 0, 0))
  5327.           || rp_isbad (retval = sm_winit (S_MAIL, bb_from)))
  5328.       return lose ("problem initializing SendMail; %s",
  5329.           rp_string (retval));
  5330. ***************
  5331. *** 380,386 ****
  5332.       if (bb_fderr == NOTOK)
  5333.       return;
  5334.   
  5335. !     if (rp_isbad (sm_init (NULLCP, NULLCP, 0, 0, 0))
  5336.           || rp_isbad (sm_winit (S_MAIL, bb_from)))
  5337.       goto sm_err;
  5338.   
  5339. --- 380,386 ----
  5340.       if (bb_fderr == NOTOK)
  5341.       return;
  5342.   
  5343. !     if (rp_isbad (sm_init (NULLCP, NULLCP, 0, 0, 0, 0, 0))
  5344.           || rp_isbad (sm_winit (S_MAIL, bb_from)))
  5345.       goto sm_err;
  5346.   
  5347. *** ../mh-6.8/uip/vmh.c    Tue Dec 15 08:56:08 1992
  5348. --- uip/vmh.c    Fri Feb 26 14:00:35 1993
  5349. ***************
  5350. *** 1,6 ****
  5351.   /* vmh.c - visual front-end to mh */
  5352.   #ifndef    lint
  5353. ! static char ident[] = "@(#)$Id: vmh.c,v 1.18 1992/12/15 00:20:22 jromine Exp $";
  5354.   #endif    /* lint */
  5355.   #if defined(SYS5) && !defined(TERMINFO)
  5356.   /*
  5357. --- 1,6 ----
  5358.   /* vmh.c - visual front-end to mh */
  5359.   #ifndef    lint
  5360. ! static char ident[] = "@(#)$Id: vmh.c,v 1.19 1993/02/26 22:00:33 jromine Exp $";
  5361.   #endif    /* lint */
  5362.   #if defined(SYS5) && !defined(TERMINFO)
  5363.   /*
  5364. ***************
  5365. *** 59,64 ****
  5366. --- 59,75 ----
  5367.   #include <termio.h>
  5368.   #define    TCGETATTR        /* tcgetattr() */
  5369.   #endif
  5370. + #ifdef    BSD44
  5371. + #define    USE_OLD_TTY
  5372. + #define    _maxx    maxx        /* curses.h */
  5373. + #define    _maxy    maxy
  5374. + #define    _curx    curx        /* curses.h */
  5375. + #define    _cury    cury
  5376. + void     __cputchar __P((int));
  5377. + #undef    _putchar
  5378. + #define    _putchar    __cputchar
  5379. + #include <sys/ioctl.h>        /* sgttyb */
  5380. + #endif
  5381.   
  5382.   #define    ALARM    ((unsigned int) 10)
  5383.   #define    PAUSE    ((unsigned int) 2)
  5384. ***************
  5385. *** 161,167 ****
  5386.   #endif    /* TIOCGLTC */
  5387.   
  5388.   
  5389. ! #ifndef    SYS5
  5390.   int    _putchar ();
  5391.   #endif    /* not SYS5 */
  5392.   #ifdef    SIGTSTP
  5393. --- 172,178 ----
  5394.   #endif    /* TIOCGLTC */
  5395.   
  5396.   
  5397. ! #if !defined(SYS5) && !defined(BSD44)
  5398.   int    _putchar ();
  5399.   #endif    /* not SYS5 */
  5400.   #ifdef    SIGTSTP
  5401. ***************
  5402. *** 1122,1128 ****
  5403. --- 1133,1143 ----
  5404.       adios (NULLCP, "unable to allocate line storage");
  5405.   
  5406.       lp -> l_no = (ltail ? ltail -> l_no : 0) + 1;
  5407. + #ifndef    BSD44
  5408.       lp -> l_buf = getcpy (w -> _y[w -> _cury]);
  5409. + #else
  5410. +     lp -> l_buf = getcpy (w -> lines[w -> _cury]->line);
  5411. + #endif
  5412.       for (cp = lp -> l_buf + strlen (lp -> l_buf) - 1; cp >= lp -> l_buf; cp--)
  5413.       if (isspace (*cp))
  5414.           *cp = 0;
  5415. *** ../mh-6.8/zotnet/mts/client.c    Tue Dec 15 08:56:18 1992
  5416. --- zotnet/mts/client.c    Fri Aug 20 08:55:48 1993
  5417. ***************
  5418. *** 1,6 ****
  5419.   /* client.c - connect to a server */
  5420.   #ifndef    lint
  5421. ! static char ident[] = "@(#)$Id: client.c,v 1.19 1992/12/15 00:20:22 jromine Exp $";
  5422.   #endif    /* lint */
  5423.   
  5424.   #if    defined(SYS5) && defined(AUX)
  5425. --- 1,6 ----
  5426.   /* client.c - connect to a server */
  5427.   #ifndef    lint
  5428. ! static char ident[] = "@(#)$Id: client.c,v 1.20 1993/08/20 15:55:35 jromine Exp $";
  5429.   #endif    /* lint */
  5430.   
  5431.   #if    defined(SYS5) && defined(AUX)
  5432. ***************
  5433. *** 88,93 ****
  5434. --- 88,105 ----
  5435.   static int rcaux (), getport (), inet ();
  5436.   #endif
  5437.   
  5438. + #if    defined(BIND) && !defined(h_addr)
  5439. + #define    h_addr    h_addr_list[0]
  5440. + #endif
  5441. + #define    inaddr_copy(hp,sin) \
  5442. +     bcopy ((hp) -> h_addr, (char *) &((sin) -> sin_addr), (hp) -> h_length)
  5443. + struct hostent *gethostbystring ();
  5444.   static int brkany ();
  5445.   static char *getcpy (), **copyip (), **brkstring ();
  5446.   
  5447. ***************
  5448. *** 173,179 ****
  5449.           continue;
  5450.       }
  5451.   
  5452. !     if (hp = gethostbyname (*ap)) {
  5453.           switch (sd = rcaux (sp, hp, rproto, response)) {
  5454.           case NOTOK: 
  5455.           case OOPS1: 
  5456. --- 185,191 ----
  5457.           continue;
  5458.       }
  5459.   
  5460. !     if (hp = gethostbystring (*ap)) {
  5461.           switch (sd = rcaux (sp, hp, rproto, response)) {
  5462.           case NOTOK: 
  5463.           case OOPS1: 
  5464. ***************
  5465. *** 223,230 ****
  5466.   
  5467.       bzero ((char *) isock, sizeof *isock);
  5468.       isock -> sin_family = hp -> h_addrtype;
  5469.       isock -> sin_port = sp -> s_port;
  5470. -     bcopy (hp -> h_addr, (char *) &isock -> sin_addr, hp -> h_length);
  5471.   
  5472.       if (connect (sd, (struct sockaddr *) isock, sizeof *isock) == NOTOK)
  5473.       switch (errno) {
  5474. --- 235,242 ----
  5475.   
  5476.       bzero ((char *) isock, sizeof *isock);
  5477.       isock -> sin_family = hp -> h_addrtype;
  5478. +     inaddr_copy (hp, isock);
  5479.       isock -> sin_port = sp -> s_port;
  5480.   
  5481.       if (connect (sd, (struct sockaddr *) isock, sizeof *isock) == NOTOK)
  5482.       switch (errno) {
  5483. ***************
  5484. *** 339,344 ****
  5485. --- 351,405 ----
  5486.   
  5487.       bcopy (hp -> h_addr, (char *) &in, sizeof in);
  5488.       return (inet_netof (in) == net);
  5489. + }
  5490. + /*   */
  5491. + /* taken from ISODE's compat/internet.c */
  5492. + #ifndef    DG
  5493. + u_long    inet_addr ();
  5494. + #else
  5495. + struct in_addr inet_addr ();
  5496. + #endif
  5497. + static char *empty = NULL;
  5498. + #ifdef    h_addr
  5499. + static char *addrs[2] = { NULL };
  5500. + #endif
  5501. + struct hostent *gethostbystring (s)
  5502. + char   *s;
  5503. + {
  5504. +     register struct hostent *h;
  5505. + #ifndef    DG
  5506. +     static u_long iaddr;
  5507. + #else
  5508. +     static struct in_addr iaddr;
  5509. + #endif
  5510. +     static struct hostent   hs;
  5511. +     iaddr = inet_addr (s);
  5512. + #ifndef    DG
  5513. +     if (iaddr == NOTOK && strcmp (s, "255.255.255.255"))
  5514. + #else
  5515. +     if (iaddr.s_addr == NOTOK && strcmp (s, "255.255.255.255"))
  5516. + #endif
  5517. +     return gethostbyname (s);
  5518. +     h = &hs;
  5519. +     h -> h_name = s;
  5520. +     h -> h_aliases = ∅
  5521. +     h -> h_addrtype = AF_INET;
  5522. +     h -> h_length = sizeof (iaddr);
  5523. + #ifdef    h_addr
  5524. +     h -> h_addr_list = addrs;
  5525. +     bzero ((char *) addrs, sizeof addrs);
  5526. + #endif
  5527. +     h -> h_addr = (char *) &iaddr;
  5528. +     return h;
  5529.   }
  5530.   
  5531.   /*   */
  5532. *** ../mh-6.8/zotnet/tws/dtimep.lex    Tue Dec 15 08:56:20 1992
  5533. --- zotnet/tws/dtimep.lex    Fri Feb 26 14:07:44 1993
  5534. ***************
  5535. *** 36,38 ****
  5536.   #ifndef    lint
  5537. ! static char ident[] = "@(#)$Id: dtimep.lex,v 2.14 1992/12/15 00:20:22 jromine Exp $";
  5538.   #endif
  5539. --- 36,38 ----
  5540.   #ifndef    lint
  5541. ! static char ident[] = "@(#)$Id: dtimep.lex,v 2.15 1993/02/26 22:07:40 jromine Exp $";
  5542.   #endif
  5543. ***************
  5544. *** 42,46 ****
  5545.   #include <sys/types.h>
  5546. ! #ifndef SYS5
  5547.   #include <sys/timeb.h>
  5548. ! #endif /* not SYS5 */
  5549.   
  5550. --- 42,46 ----
  5551.   #include <sys/types.h>
  5552. ! #if !defined(SYS5) && !defined(ZONEINFO)
  5553.   #include <sys/timeb.h>
  5554. ! #endif /* !defined(SYS5) && !defined(ZONEINFO) */
  5555.   
  5556. ***************
  5557. *** 170,173 ****
  5558.   #ifndef SYS5
  5559.       struct timeb    tb;
  5560. ! #endif /* not SYS5 */
  5561.       long tclock;
  5562. --- 170,178 ----
  5563.   #ifndef SYS5
  5564. + #ifdef ZONEINFO
  5565. +     struct tm      *tm;
  5566. +     time_t        clock;
  5567. + #else
  5568.       struct timeb    tb;
  5569. ! #endif    /* ZONEINFO */
  5570. ! #endif    /* not SYS5 */
  5571.       long tclock;
  5572. ***************
  5573. *** 180,185 ****
  5574.       /* Set default time zone. */
  5575. ! #ifndef SYS5
  5576. !     ftime( &tb );
  5577. !     tw.tw_zone = -tb.timezone;
  5578. ! #else /* SYS5 */
  5579.       tzset( );
  5580. --- 185,187 ----
  5581.       /* Set default time zone. */
  5582. ! #ifdef SYS5
  5583.       tzset( );
  5584. ***************
  5585. *** 186,188 ****
  5586.       tw.tw_zone = -(timezone / 60);
  5587. ! #endif /* SYS5 */
  5588.   
  5589. --- 188,201 ----
  5590.       tw.tw_zone = -(timezone / 60);
  5591. ! #else
  5592. ! #ifdef ZONEINFO
  5593. !     time (&clock);
  5594. !     tm = localtime(&clock);
  5595. !     tw.tw_zone = tm->tm_gmtoff / 60;
  5596. !     if (tm -> tm_isdst)            /* if DST is in effect */
  5597. !         tw.tw_zone -= 60;        /* reset to normal offset */
  5598. ! #else
  5599. !     ftime( &tb );
  5600. !     tw.tw_zone = -tb.timezone;
  5601. ! #endif    /* ZONEINFO */
  5602. ! #endif    /* SYS5 */
  5603.   
  5604. *** /dev/null    Fri Aug 20 12:27:17 1993
  5605. --- sbr/ruserpass.c    Fri Feb 26 10:58:37 1993
  5606. ***************
  5607. *** 0 ****
  5608. --- 1,216 ----
  5609. + /*
  5610. +  * Copyright (c) 1985 Regents of the University of California.
  5611. +  * All rights reserved.
  5612. +  *
  5613. +  * Redistribution and use in source and binary forms are permitted
  5614. +  * provided that the above copyright notice and this paragraph are
  5615. +  * duplicated in all such forms and that any documentation,
  5616. +  * advertising materials, and other materials related to such
  5617. +  * distribution and use acknowledge that the software was developed
  5618. +  * by the University of California, Berkeley.  The name of the
  5619. +  * University may not be used to endorse or promote products derived
  5620. +  * from this software without specific prior written permission.
  5621. +  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  5622. +  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  5623. +  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  5624. +  */
  5625. + #ifndef lint
  5626. + static char sccsid[] = "@(#)ruserpass.c    5.1 (Berkeley) 3/1/89";
  5627. + #endif /* not lint */
  5628. + #include <sys/types.h>
  5629. + #include <sys/stat.h>
  5630. + #include <stdio.h>
  5631. + #include <ctype.h>
  5632. + #include <pwd.h>
  5633. + #include <errno.h>
  5634. + char    *malloc(), *index(), *getenv(), *getpass(), *getlogin();
  5635. + char    *strcpy();
  5636. + static    FILE *cfile;
  5637. + #ifndef MAXHOSTNAMELEN
  5638. + #define MAXHOSTNAMELEN 64
  5639. + #endif
  5640. + #define    DEFAULT    1
  5641. + #define    LOGIN    2
  5642. + #define    PASSWD    3
  5643. + #define    ACCOUNT 4
  5644. + #define MACDEF  5
  5645. + #define    ID    10
  5646. + #define    MACH    11
  5647. + static int token();
  5648. + static char tokval[100];
  5649. + static struct toktab {
  5650. +     char *tokstr;
  5651. +     int tval;
  5652. + } toktab[]= {
  5653. +     "default",    DEFAULT,
  5654. +     "login",    LOGIN,
  5655. +     "password",    PASSWD,
  5656. +     "passwd",    PASSWD,
  5657. +     "account",    ACCOUNT,
  5658. +     "machine",    MACH,
  5659. +     "macdef",    MACDEF,
  5660. +     0,        0
  5661. + };
  5662. + ruserpass(host, aname, apass)
  5663. +      char *host, **aname, **apass;
  5664. + {
  5665. +     char *hdir, buf[BUFSIZ], *tmp;
  5666. +     char myname[MAXHOSTNAMELEN], *mydomain;
  5667. +     int t, i, c, usedefault = 0;
  5668. +     struct stat stb;
  5669. +     extern int errno;
  5670. +     hdir = getenv("HOME");
  5671. +     if (hdir == NULL)
  5672. +         hdir = ".";
  5673. +     (void) sprintf(buf, "%s/.netrc", hdir);
  5674. +     cfile = fopen(buf, "r");
  5675. +     if (cfile == NULL) {
  5676. +         if (errno != ENOENT)
  5677. +             perror(buf);
  5678. +         goto done;
  5679. +     }
  5680. +     while ((t = token())) switch(t) {
  5681. +     case DEFAULT:
  5682. +         usedefault = 1;
  5683. +         /* FALL THROUGH */
  5684. +     case MACH:
  5685. +         if (!usedefault) {
  5686. +             if (token() != ID)
  5687. +                 continue;
  5688. +             /*
  5689. +              * Allow match either for user's host name.
  5690. +              */
  5691. +             if (strcasecmp(host, tokval) == 0)
  5692. +                 goto match;
  5693. +             continue;
  5694. +         }
  5695. +     match:
  5696. +         while ((t = token()) && t != MACH && t != DEFAULT) switch(t) {
  5697. +         case LOGIN:
  5698. +             if (token() && *aname == 0) {
  5699. +                 *aname = malloc((unsigned) strlen(tokval) + 1);
  5700. +                 (void) strcpy(*aname, tokval);
  5701. +             }
  5702. +             break;
  5703. +         case PASSWD:
  5704. +             if (fstat(fileno(cfile), &stb) >= 0 &&
  5705. +                 (stb.st_mode & 077) != 0) {
  5706. +     fprintf(stderr, "Error - .netrc file not correct mode.\n");
  5707. +     fprintf(stderr, "Remove password or correct mode.\n");
  5708. +                 goto bad;
  5709. +             }
  5710. +             if (token() && *apass == 0) {
  5711. +                 *apass = malloc((unsigned) strlen(tokval) + 1);
  5712. +                 (void) strcpy(*apass, tokval);
  5713. +             }
  5714. +             break;
  5715. +         case ACCOUNT:
  5716. +             break;
  5717. +         case MACDEF:
  5718. +             goto done_close;
  5719. +             break;
  5720. +         default:
  5721. +     fprintf(stderr, "Unknown .netrc keyword %s\n", tokval);
  5722. +             break;
  5723. +         }
  5724. +         goto done;
  5725. +     }
  5726. + done_close:
  5727. +     (void) fclose(cfile);
  5728. + done:
  5729. +     if (!*aname) {
  5730. +         char tmp[80];
  5731. +         char *myname;
  5732. +         if ((myname = getlogin()) == NULL) {
  5733. +             struct passwd *pp;
  5734. +             if ((pp = getpwuid (getuid())) != NULL)
  5735. +                 myname = pp->pw_name;
  5736. +         }
  5737. +         printf("Name (%s:%s): ", host, myname);
  5738. +         (void) fgets(tmp, sizeof(tmp) - 1, stdin);
  5739. +         tmp[strlen(tmp) - 1] = '\0';
  5740. +         if (*tmp != '\0') {
  5741. +             myname = tmp;
  5742. +         }
  5743. +         *aname = malloc((unsigned) strlen(myname) + 1);
  5744. +         strcpy (*aname, myname);
  5745. +     }
  5746. +     if (!*apass) {
  5747. +         char prompt[256];
  5748. +         char *mypass;
  5749. +         sprintf(prompt, "Password (%s:%s): ", host, *aname);
  5750. +         mypass = getpass (prompt);
  5751. +     
  5752. +         if (*mypass == '\0') {
  5753. +             mypass = *aname;
  5754. +         }
  5755. +         *apass = malloc((unsigned) strlen(mypass) + 1);
  5756. +         strcpy (*apass, mypass);
  5757. +     }
  5758. +     return(0);
  5759. + bad:
  5760. +     (void) fclose(cfile);
  5761. +     return(-1);
  5762. + }
  5763. + static int
  5764. + token()
  5765. + {
  5766. +     char *cp;
  5767. +     int c;
  5768. +     struct toktab *t;
  5769. +     if (feof(cfile))
  5770. +         return (0);
  5771. +     while ((c = getc(cfile)) != EOF &&
  5772. +         (c == '\n' || c == '\t' || c == ' ' || c == ','))
  5773. +         continue;
  5774. +     if (c == EOF)
  5775. +         return (0);
  5776. +     cp = tokval;
  5777. +     if (c == '"') {
  5778. +         while ((c = getc(cfile)) != EOF && c != '"') {
  5779. +             if (c == '\\')
  5780. +                 c = getc(cfile);
  5781. +             *cp++ = c;
  5782. +         }
  5783. +     } else {
  5784. +         *cp++ = c;
  5785. +         while ((c = getc(cfile)) != EOF
  5786. +             && c != '\n' && c != '\t' && c != ' ' && c != ',') {
  5787. +             if (c == '\\')
  5788. +                 c = getc(cfile);
  5789. +             *cp++ = c;
  5790. +         }
  5791. +     }
  5792. +     *cp = 0;
  5793. +     if (tokval[0] == 0)
  5794. +         return (0);
  5795. +     for (t = toktab; t->tokstr; t++)
  5796. +         if (!strcmp(t->tokstr, tokval))
  5797. +             return (t->tval);
  5798. +     return (ID);
  5799. + }
  5800. *** ../mh-6.8/miscellany/multi-media/READ-ME    Tue Dec 15 08:54:04 1992
  5801. --- miscellany/multi-media/READ-ME    Fri Aug 20 08:36:53 1993
  5802. ***************
  5803. *** 257 ****
  5804. --- 257,268 ----
  5805.        can fiddle with the volume controls whenever you like.
  5806. +                     video
  5807. +      If you are running the X window system, you can use the mpeg_play
  5808. +      program to display a video/mpeg content.
  5809. +     host    toe.cs.berkeley.edu
  5810. +     dir    pub/multimedia/mpeg/
  5811. +     file    mpeg-2.0.tar.Z
  5812. +     mode    binary
  5813. *** /dev/null    Fri Aug 20 12:27:17 1993
  5814. --- miscellany/multi-media/misc/mail-server.sh    Fri Aug 20 08:36:55 1993
  5815. ***************
  5816. *** 0 ****
  5817. --- 1,221 ----
  5818. + : run this script through /bin/sh
  5819. + PERSON="$1" SERVER="$2" AREA="$3"
  5820. + export PERSON
  5821. + if [ -z "$PERSON" -o -z "$SERVER" -o -z "$AREA" -o ! -d "$AREA" ]; then
  5822. +     exit 1
  5823. + fi
  5824. + GAWK="/usr/local/bin/gawk"
  5825. + MHL="/usr/local/lib/mh/mhl -nobell"
  5826. + MHMAIL="/usr/local/bin/mhmail"
  5827. + SCAN="/usr/local/bin/scan -width 512"
  5828. + MHN="/usr/local/bin/mhn"
  5829. + SEND="/usr/local/bin/send"
  5830. + FILE="/usr/bin/file"
  5831. + VIAMAIL="/usr/local/lib/mh/viamail"
  5832. + PATH=$PATH:/etc:/bin:/usr/ucb:/usr/bin:/usr/local/bin export PATH
  5833. + if [ date +"%m/%d %T" > /dev/null 2>&1 ]; then
  5834. +     DATE="date +\"%m/%d %T\" | tr '\012' ' '"
  5835. + else
  5836. +     DATE="date | ${GAWK} '{ printf \"%s %s %s \",  \$2, \$3, \$4 }'"
  5837. + fi
  5838. + P=/tmp/mail$$.prf   C=/tmp/mail$$.ctx    F=/tmp/mail$$    Z=/tmp/mail$$.log
  5839. + M=1 N=2
  5840. + trap "rm -rf $P $C $F $Z" 0 1 2 3 13 15
  5841. + cd /tmp
  5842. + umask 0022
  5843. + echo "Path: /tmp" > $P
  5844. + MH="$P" export MH
  5845. + echo "Current-Folder: $F" > $C
  5846. + MHCONTEXT="$C" export MHCONTEXT
  5847. + mkdir $F
  5848. + chmod 700 $F
  5849. + sed -e 1d > $F/$M
  5850. + FROM=`$SCAN -format "%<{reply-to}%{reply-to}%|%<{from}%{from}%|%<{sender}%{sender}%|%<{return-path}%{return-path}%>%>%>%>" $M`
  5851. + SUBJECT=`$SCAN -format "%{subject}" $M | tr A-Z a-z`
  5852. + cd $AREA
  5853. + W="`whoami`"
  5854. + STAMP="`echo $SERVER $$ $W | $GAWK '{ printf \"%-8.8s %05d (%-8s)\", $1, $2, $3; }'`"
  5855. + (eval ${DATE})                     > $Z
  5856. + echo "$STAMP" BEGIN "$FROM" "$SUBJECT"        >> $Z
  5857. + cat $Z >> /var/tmp/mail-server.log
  5858. + $MHL -form mhl.body < $F/$M | while read directive
  5859. + do
  5860. +     cmd="`echo "$directive" | sed -e s'%\([A-Za-z0-9-]*\).*%\1%' | tr A-Z a-z`"
  5861. +     if [ -z "$cmd" ]; then
  5862. +     continue
  5863. +     fi;
  5864. +              
  5865. +     (eval ${DATE})                 > $Z
  5866. +     echo "$STAMP" "$directive"            >> $Z
  5867. +     cat $Z >> /var/tmp/mail-server.log
  5868. +     arg="`echo $directive | sed -e 's%[A-Za-z0-9-]*[     ]*\(.*\)[     ]*%\1%'`"
  5869. +     case "$cmd" in
  5870. +     path)    if [ -z "$arg" ]; then
  5871. +             (eval ${DATE})                    > $Z
  5872. +             echo "$STAMP" "path command requires argument" >> $Z
  5873. +             cat $Z >> /var/tmp/mail-server.log
  5874. +             $MHMAIL "$FROM" -subject "Re: $SUBJECT ($directive)" \
  5875. +             -from "$PERSON" -cc "$PERSON" \
  5876. +             -body "path command requires argument"
  5877. +         else
  5878. +             FROM="$arg"
  5879. +             continue
  5880. +         fi
  5881. +         ;;        
  5882. +     send)    for P in $arg; do
  5883. +             if echo "$P" | egrep -s "\.\./|^/"; then
  5884. +             (eval ${DATE})                     > $Z
  5885. +             echo "$STAMP" "$P: invalid package"        >> $Z
  5886. +             cat $Z >> /var/tmp/mail-server.log
  5887. +             $MHMAIL "$FROM" -subject "Re: $SUBJECT ($directive)" \
  5888. +                 -from "$PERSON" -cc "$PERSON" \
  5889. +                 -body "$P: invalid package"
  5890. +             break 2
  5891. +             fi
  5892. +             if [ ! -s "$P" ]; then
  5893. +             (eval ${DATE})                     > $Z
  5894. +             echo "$STAMP" "$P: no such package"        >> $Z
  5895. +             cat $Z >> /var/tmp/mail-server.log
  5896. +             $MHMAIL "$FROM" -subject "Re: $SUBJECT ($directive)" \
  5897. +                 -from "$PERSON" -cc "$PERSON" \
  5898. +                 -body "$P: no such package"
  5899. +             break 2
  5900. +             fi
  5901. +             T="`${FILE} $P | ${GAWK} '{ print $2; }`"
  5902. +             if [ ! \( "$T" = "ascii" -o "$T" = "English" \) ]; then
  5903. +             (case $P in
  5904. +                 *.tar.Z)
  5905. +                 cat $P
  5906. +                 ;;
  5907. +                 *.tar)
  5908. +                 compress -c $P
  5909. +                 ;;
  5910. +                 *)
  5911. +                 tar cvf - $P | compress -c
  5912. +                 ;;
  5913. +             esac) | ${MHN} -viamail "$FROM" -viasubj "Re: $SUBJECT ($directive)" \
  5914. +                     -viaparm "type=tar; conversions=x-compress" \
  5915. +                     -viacmnt "extract with uncompress | tar xvpf -" \
  5916. +                     -viadelay 180 \
  5917. +                     -verbose "$PERSON" 
  5918. +             if [ $? -eq 0 ]; then
  5919. +                 true
  5920. +             else
  5921. +                 (eval ${DATE})               > $Z
  5922. +                 echo "$STAMP" "error sending viamail" >> $Z
  5923. +                 cat $Z >> /var/tmp/mail-server.log
  5924. +                 $MHMAIL "$FROM" \
  5925. +                 -subject "Re: $SUBJECT ($directive)" \
  5926. +                 -from "$PERSON" -cc "$PERSON" \
  5927. +                 -body "error sending viamail"
  5928. +             fi
  5929. +             else
  5930. +             echo "\
  5931. + To: $FROM
  5932. + Subject: Re: $SUBJECT ($directive)
  5933. + From: $PERSON
  5934. + #text/plain [] $P
  5935. + " > $F/$N
  5936. +             if mhdraft=$F/$N $MHN $F/$N; then
  5937. +                 if $SEND -draftf +$F -draftm $N -split 180; then
  5938. +                 true
  5939. +                 else
  5940. +                 (eval ${DATE})                 > $Z
  5941. +                 echo "$STAMP" "error sending draft"    >> $Z
  5942. +                 cat $Z >> /var/tmp/mail-server.log
  5943. +                 $MHMAIL "$FROM" \
  5944. +                     -subject "Re: $SUBJECT ($directive)" \
  5945. +                     -from "$PERSON" -cc "$PERSON" \
  5946. +                     -body "error sending draft"
  5947. +                 fi
  5948. +             else
  5949. +                 (eval ${DATE})                 > $Z
  5950. +                 echo "$STAMP" "error generating draft"    >> $Z
  5951. +                 cat $Z >> /var/tmp/mail-server.log
  5952. +                 $MHMAIL "$FROM" \
  5953. +                 -subject "Re: $SUBJECT ($directive)" \
  5954. +                 -from "$PERSON" -cc "$PERSON" \
  5955. +                 -body "error generating draft"
  5956. +             fi
  5957. +             fi
  5958. +         done
  5959. +         continue
  5960. +         ;;
  5961. +     dir)    if echo "$arg" | egrep -s "\.\./|^/"; then
  5962. +             (eval ${DATE})                 > $Z
  5963. +             echo "$STAMP" "$arg: invalid package"    >> $Z
  5964. +             cat $Z >> /var/tmp/mail-server.log
  5965. +             $MHMAIL "$FROM" -subject "Re: $SUBJECT ($directive)" \
  5966. +             -from "$PERSON" -cc "$PERSON" \
  5967. +             -body "$arg: invalid package"
  5968. +         else
  5969. +             /bin/ls -alg $arg | \
  5970. +                 $MHMAIL "$FROM" -subject "Re: $SUBJECT ($directive)" \
  5971. +                 -from "$PERSON"
  5972. +             continue
  5973. +         fi
  5974. +         ;;
  5975. +     help)    if [ -s Help ]; then
  5976. +             $MHMAIL "$FROM" -subject "Re: $SUBJECT ($directive)" \
  5977. +             -from "$PERSON" < Help
  5978. +         else
  5979. +             (eval ${DATE})                     > $Z
  5980. +             echo "$STAMP" "no help available, please try later" >> $Z
  5981. +             cat $Z >> /var/tmp/mail-server.log
  5982. +             $MHMAIL "$FROM" -subject "Re: $SUBJECT ($directive)" \
  5983. +             -from "$PERSON" -cc "$PERSON" \
  5984. +             -body "no help available, please try later"
  5985. +         fi
  5986. +         continue
  5987. +         ;;
  5988. +     exit|end)
  5989. +         ;;
  5990. +     *)    (eval ${DATE})                     > $Z
  5991. +         echo "$STAMP" "invalid directive: $directive"    >> $Z
  5992. +         cat $Z >> /var/tmp/mail-server.log
  5993. +         $MHMAIL "$FROM" -subject "Re: $SUBJECT ($directive)" \
  5994. +             -from "$PERSON" -cc "$PERSON" \
  5995. +             -body "invalid directive: $directive"
  5996. +         ;;
  5997. +     esac
  5998. +     break
  5999. + done
  6000. + (eval ${DATE})                     > $Z
  6001. + echo "$STAMP" DONE                >> $Z
  6002. + cat $Z >> /var/tmp/mail-server.log
  6003. + exit 0
  6004. *** /dev/null    Fri Aug 20 12:27:17 1993
  6005. --- miscellany/multi-media/misc/mimeplay.sh    Fri Aug 20 08:36:56 1993
  6006. ***************
  6007. *** 0 ****
  6008. --- 1,13 ----
  6009. + #!/bin/sh -f
  6010. + P=/tmp/mime$$.mhn Q=/tmp/mime$$.sh
  6011. + cat > $P
  6012. + echo "trap \"rm -f $P $Q\" 0 1 2 3 13 15"         > $Q
  6013. + echo "mhn -file $P -show"                >> $Q
  6014. + echo "echo -n \"Press <return> to continue... \""    >> $Q
  6015. + echo "read x"                        >> $Q
  6016. + chmod +x $Q
  6017. + (xterm -e $Q >/dev/null 2>&1 &) &
  6018. *** /dev/null    Fri Aug 20 12:27:17 1993
  6019. --- miscellany/multi-media/misc/showmime.tcl    Fri Aug 20 08:36:57 1993
  6020. ***************
  6021. *** 0 ****
  6022. --- 1,108 ----
  6023. + #!/usr/local/bin/wish -f
  6024. + if {$argc != 1} {
  6025. +     puts    stdout    "usage: showmime.tcl fileName"
  6026. +     exit    1
  6027. + }
  6028. + set    bodyParts    ""
  6029. + set    fileName    [lindex $argv 0]
  6030. + set    maxX        [expr [winfo screenwidth .]*5/12]
  6031. + set    maxY        [expr [winfo screenheight .]*2/3]
  6032. + set    nextX        0
  6033. + set    nextY        0
  6034. + proc    main    {w} {
  6035. +     global    bodyParts fileName
  6036. +     set        list        [exec mhn -list -file "$fileName"]
  6037. +     set        lines        [split "$list" "\n"]
  6038. +     frame    $w.frame    -borderwidth 10
  6039. +     pack append    $w.frame    [label $w.frame.label \
  6040. +                     -font -*courier-medium-r-normal-*-120-* \
  6041. +                     -relief sunken \
  6042. +                     -text "part  type/subtype              size description                         "] \
  6043. +                     {top fillx}
  6044. +     catch { $w.frame.label configure -background lightskyblue }
  6045. +     if {[set nline [expr [llength $lines]-1]] > 10} {
  6046. +     pack append $w.frame    [scrollbar $w.frame.yscroll \
  6047. +                     -command "$w.frame.list yview" \
  6048. +                     -orient vertical \
  6049. +                     -relief sunken] \
  6050. +                     {right filly}
  6051. +     set    y    10
  6052. +     } else {
  6053. +     set    y    $nline
  6054. +     }
  6055. +     pack append $w.frame    [listbox $w.frame.list \
  6056. +                     -font -*courier-medium-r-normal-*-120-* \
  6057. +                     -geometry 73x$y \
  6058. +                     -relief sunken] \
  6059. +                 {top expand}
  6060. +     if {$nline > 10} {
  6061. +     $w.frame.list configure    -yscroll "$w.frame.yscroll set"
  6062. +     }
  6063. +     catch { $w.frame.list configure -background lightskyblue }
  6064. +     set        part        ""
  6065. +     for {set i 1; set j [llength $lines]} {$i<$j} {incr i} {
  6066. +     set    line    [string range [lindex $lines $i] 5 end]
  6067. +     if {[string index "$line" 0] != " "} {
  6068. +         set    part    [string range "$line" 0 \
  6069. +                 [expr [string first " " "$line"]-1]]
  6070. +     }
  6071. +     lappend    bodyParts    "$part"
  6072. +     if {$i == 1} {
  6073. +         set    line    "all  [string range "$line" 5 end]"
  6074. +     }
  6075. +     $w.frame.list \
  6076. +         insert    end    "$line"
  6077. +     }
  6078. +     bind    $w.frame.list    <1>    {%W select from [%W nearest %y]}
  6079. +     bind    $w.frame.list    <B1-Motion>\
  6080. +                     {%W select to [%W nearest %y]}
  6081. +     bind    $w.frame.list    <Shift-1> \
  6082. +                     {%W select adjust [%W nearest %y]}
  6083. +     bind    $w.frame.list    <Shift-B1-Motion> \
  6084. +                     {%W select to [%W nearest %y]}
  6085. +     bind    $w.frame.list    <Double-1> \
  6086. +                     "ShowCommand $w.frame.list"
  6087. +     frame    $w.bot        -borderwidth 1
  6088. +     pack append    $w.bot        [button $w.bot.button \
  6089. +                     -command "destroy ." \
  6090. +                     -text Dismiss] \
  6091. +                     {top padx 5 pady 5 expand}
  6092. +     pack append    .        $w.frame \
  6093. +                     {top expand filly} \
  6094. +                 $w.bot \
  6095. +                     {bottom fill}
  6096. + }
  6097. + proc    ShowCommand    {w} {
  6098. +     global    bodyParts fileName maxX maxY nextX nextY
  6099. +     foreach    i    [$w curselection] {
  6100. +     if {[set part [lindex $bodyParts $i]] != ""} {
  6101. +         exec xterm    -geometry =80x20+$nextX+$nextY -e \
  6102. +             mhn -cache always -form mhl.null -nolist -nopause -show -part "$part" -file "$fileName" &
  6103. +     } else {
  6104. +         exec xterm    -geometry =80x20+$nextX+$nextY -e \
  6105. +             mhn -cache always -form mhl.null -nolist -nopause -show -file "$fileName" &
  6106. +     }
  6107. +     if {[set nextX [expr $nextX+90]] > $maxX} {
  6108. +         set    nextX    0
  6109. +     }
  6110. +     if {[set nextY [expr $nextY+60]] > $maxY} {
  6111. +         set    nextY    0
  6112. +     }
  6113. +     }
  6114. +     $w select clear
  6115. + }
  6116. + main ""
  6117. *** ../mh-6.8/miscellany/multi-media/misc/showtimes.sh    Tue Dec 15 08:54:05 1992
  6118. --- miscellany/multi-media/misc/showtimes.sh    Fri Aug 20 08:36:57 1993
  6119. ***************
  6120. *** 70,72 ****
  6121.               -title "$O (part $A of $N$M)" -e \
  6122. !             mhn -nolist -show -part "$A" $F $M &
  6123.   
  6124. --- 70,72 ----
  6125.               -title "$O (part $A of $N$M)" -e \
  6126. !             mhn -cache always -form mhl.null -nolist -nopause -show -part "$A" $F $M &
  6127.   
  6128. *** ../mh-6.8/miscellany/multi-media/profiles/mhn_defaults    Tue Dec 15 08:54:05 1992
  6129. --- miscellany/multi-media/profiles/mhn_defaults    Fri Aug 20 08:36:58 1993
  6130. ***************
  6131. *** 1,5 ****
  6132. - mhn-compose-audio/basic: /usr/demo/SOUND/record | /usr/demo/SOUND/raw2audio -F
  6133. - mhn-compose-audio/x-next: /usr/demo/SOUND/record | /usr/openwin/bin/adpcm_enc
  6134.   mhn-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s
  6135.   mhn-show-application/PostScript: %plpr -Pps
  6136.   mhn-show-audio/basic: %p/usr/demo/SOUND/raw2audio 2>/dev/null | play
  6137. --- 1,6 ----
  6138.   mhn-charset-iso-8859-1: xterm -fn '-*-*-medium-r-normal-*-*-120-*-*-c-*-iso8859-*' -e %s
  6139. + mhn-compose-audio/basic: /usr/openwin/bin/audiotool %f && /usr/demo/SOUND/raw2audio -F < %f
  6140. + mhn-compose-audio/x-next: /usr/openwin/bin/audiotool %f && /usr/openwin/bin/adpcm_enc < %f
  6141.   mhn-show-application/PostScript: %plpr -Pps
  6142. + mhn-show-application/x-ivs: %pivs_replay -o '%F'
  6143.   mhn-show-audio/basic: %p/usr/demo/SOUND/raw2audio 2>/dev/null | play
  6144. ***************
  6145. *** 6,9 ****
  6146.   mhn-show-audio/x-next: %p/usr/openwin/bin/adpcm_dec | /usr/demo/SOUND/play
  6147. ! mhn-show-image: %pxv -geometry =-0+0 %f
  6148. ! mhn-show-text/richtext: %p/usr/local/lib/mh/richtext -p %F
  6149.   mhn-store-application/PostScript: %m%P.ps
  6150. --- 7,12 ----
  6151.   mhn-show-audio/x-next: %p/usr/openwin/bin/adpcm_dec | /usr/demo/SOUND/play
  6152. ! mhn-show-image: %pxv -geometry =-0+0 '%f'
  6153. ! mhn-show-text/richtext: %p/usr/local/lib/mh/richtext -p '%F'
  6154. ! mhn-show-text/x-richtext: %pwish -file /usr/local/lib/mh/richtext.tcl < '%f'
  6155. ! mhn-show-video/mpeg: %pmpeg_play '%f'
  6156.   mhn-store-application/PostScript: %m%P.ps
  6157. ***************
  6158. *** 12 ****
  6159. --- 15,17 ----
  6160.   mhn-store-text: %m%P.txt
  6161. + mhn-store-text/richtext: %m%P.rt
  6162. + mhn-store-video/mpeg: %m%P.mpg
  6163. *** ../mh-6.8/miscellany/multi-media/profiles/mtr.mh_profile    Tue Dec 15 08:54:06 1992
  6164. --- miscellany/multi-media/profiles/mtr.mh_profile    Fri Aug 20 08:36:59 1993
  6165. ***************
  6166. *** 30,33 ****
  6167.               -whatnow push
  6168. - oops:        -annotate -fcc +outbox -form repl.oops -inplace -nocc all
  6169. -             -whatnow push
  6170.   pick:        -sequence select -list
  6171. --- 30,31 ----
  6172. ***************
  6173. *** 37,39 ****
  6174.   prev:        -noheader
  6175. ! push:        -alias aliases -forward -mime -msgid -push -verbose
  6176.   pushf:        -push
  6177. --- 35,37 ----
  6178.   prev:        -noheader
  6179. ! push:        -alias aliases -forward -mime -msgid -push -split 0 -verbose
  6180.   pushf:        -push
  6181. ***************
  6182. *** 42,45 ****
  6183.   scan:        -form scan.time
  6184. ! send:        -alias aliases -mime -msgid -verbose
  6185. ! sendf:        -alias aliases -mime -msgid -verbose -draftfolder +drafts
  6186.   show:        -noheader
  6187. --- 40,44 ----
  6188.   scan:        -form scan.time
  6189. ! send:        -alias aliases -mime -msgid -split 0 -verbose
  6190. ! sendf:        -alias aliases -mime -msgid -split 0 -verbose
  6191. !             -draftfolder +drafts
  6192.   show:        -noheader
  6193. ***************
  6194. *** 48,49 ****
  6195. --- 47,50 ----
  6196.               -whatnow push
  6197. + tpcfaq:        -annotate -fcc +outbox -form repl.tpcfaq -inplace -nocc all
  6198. +             -whatnow push
  6199.   whom:        -alias aliases
  6200. ***************
  6201. *** 52,54 ****
  6202.               -whatnow push
  6203. - Split-Delay:    180
  6204.   automhnproc:    mhn
  6205. --- 53,54 ----
  6206. ***************
  6207. *** 56,58 ****
  6208.   mcomp:        -editor rapid -form comp.mhn
  6209. ! mhn:        -list -nomoreproc
  6210.   mhn-cache:    /tmp
  6211. --- 56,58 ----
  6212.   mcomp:        -editor rapid -form comp.mhn
  6213. ! mhn:        -cache always -list -nomoreproc
  6214.   mhn-cache:    /tmp
  6215. ***************
  6216. *** 59 ****
  6217. --- 59,62 ----
  6218.   mhn-storage:    /tmp
  6219. + mhn-show-application/remote-printing: cat
  6220. + mhn-store-application/remote-printing: %m%P.rp
  6221. + rpprompter: -noprepend -rapid
  6222. *** ../mh-6.8/miscellany/multi-media/profiles/mtr.mhn_profile.openwindows    Tue Dec 15 08:54:06 1992
  6223. --- miscellany/multi-media/profiles/mtr.mhn_profile.openwindows    Fri Aug 20 08:36:59 1993
  6224. ***************
  6225. *** 1 ****
  6226. ! mhn-show-application/PostScript: pageview -
  6227. --- 1,2 ----
  6228. ! mhn-show-application/PostScript: gs -q -dSAFER -- %F
  6229. ! mhn-store-message/rfc822: %m%P.msg
  6230. *** ../mh-6.8/miscellany/multi-media/profiles/mtr.mhn_profile.xterminal    Tue Dec 15 08:54:06 1992
  6231. --- miscellany/multi-media/profiles/mtr.mhn_profile.xterminal    Fri Aug 20 08:37:00 1993
  6232. ***************
  6233. *** 0 ****
  6234. --- 1,7 ----
  6235. + mhn-compose-audio/basic: 
  6236. + mhn-compose-audio/x-next: 
  6237. + mhn-show-audio/basic: 
  6238. + mhn-show-audio/x-next: 
  6239. + mhn-show-application/PostScript:
  6240. + mhn-store-audio/basic:
  6241. + mhn-store-audio/x-next:
  6242. *** /dev/null    Fri Aug 20 12:27:17 1993
  6243. --- miscellany/multi-media/richtext.tcl    Fri Aug 20 08:37:01 1993
  6244. ***************
  6245. *** 0 ****
  6246. --- 1,210 ----
  6247. + #! /usr/local/bin/wish -f
  6248. + proc    richtext        {{w .richtext}} {
  6249. +     catch    {destroy $w}
  6250. +     toplevel    $w
  6251. +     wm title    $w        "Richtext"
  6252. +     wm iconname    $w        "rt"
  6253. +     text    $w.text        -borderwidth 2 \
  6254. +                 -height 34 \
  6255. +                 -relief raised \
  6256. +                 -setgrid true \
  6257. +                 -width 80 \
  6258. +                 -wrap word \
  6259. +                 -yscrollcommand "$w.scroll set"
  6260. +     scrollbar    $w.scroll    -command "$w.text yview" \
  6261. +                 -relief flat
  6262. +     frame    $w.bot        -borderwidth 1
  6263. +     pack append    $w.bot        [button $w.bot.button \
  6264. +                     -command "destroy $w;destroy ." \
  6265. +                     -text Dismiss] \
  6266. +                     {top padx 5 pady 5 expand}
  6267. +     pack append    $w        $w.bot \
  6268. +                     {bottom fillx} \
  6269. +                 $w.scroll \
  6270. +                     {right filly} \
  6271. +                 $w.text \
  6272. +                     {expand fill}
  6273. +     $w.text tag    configure    bold \
  6274. +                     -font -*-courier-bold-r-normal-*-120-*
  6275. +     $w.text tag configure    italic \
  6276. +                     -font -*-courier-medium-o-normal-*-120-*
  6277. +     $w.text tag configure    bolditalic \
  6278. +                     -font -*-courier-bold-o-normal-*-120-*
  6279. +     $w.text tag configure    fixed \
  6280. +                     -font -*-courier-medium-r-normal-*-120-*
  6281. +     $w.text tag configure    bigbold \
  6282. +                     -font -*-courier-bold-r-normal-*-140-*
  6283. +     $w.text tag configure    bigitalic \
  6284. +                     -font -*-courier-medium-o-normal-*-140-*
  6285. +     $w.text tag configure    bigbolditalic \
  6286. +                     -font -*-courier-bold-o-normal-*-140-*
  6287. +     $w.text tag configure    bigfixed \
  6288. +                     -font -*-courier-medium-r-normal-*-140-*
  6289. +     $w.text tag configure    smallbold \
  6290. +                     -font -*-courier-bold-r-normal-*-100-*
  6291. +     $w.text tag configure    smallitalic \
  6292. +                     -font -*-courier-medium-o-normal-*-100-*
  6293. +     $w.text tag configure    smallbolditalic \
  6294. +                     -font -*-courier-bold-o-normal-*-100-*
  6295. +     $w.text tag configure    smallfixed \
  6296. +                     -font -*-courier-medium-r-normal-*-100-*
  6297. +     $w.text tag configure    underline \
  6298. +                     -underline on
  6299. +     set        env(bold)    0
  6300. +     set        env(italic)    0
  6301. +     set        env(fixed)    0
  6302. +     set        env(smaller)    0
  6303. +     set        env(bigger)    0
  6304. +     set        env(underline)    0
  6305. +     set        env(center)    0
  6306. +     set        env(flushleft)    0
  6307. +     set        env(flushright)    0
  6308. +     set        env(indent)    0
  6309. +     set        env(indentright) 0
  6310. +     set        env(outdent)    0
  6311. +     set        env(outdentright) 0
  6312. +     set        env(samepage)    0
  6313. +     set        env(superscript) 0
  6314. +     set        env(subscript)    0
  6315. +     set        env(heading)    0
  6316. +     set        env(footing)    0
  6317. +     set        env(excerpt)    0
  6318. +     set        env(paragraph)    0
  6319. +     set        env(signature)    0
  6320. +     set        intoken        0
  6321. +     set        token        ""
  6322. +     set        incomment    0
  6323. +     set        output        ""
  6324. +     set        lasto        " "
  6325. +     while {[set len [gets stdin buffer]] > -1} {
  6326. +     if {(!$intoken) && ($lasto != " ")} {
  6327. +         append    output    [set lasto " "]
  6328. +     }
  6329. +     for {set i 0} {$i < $len} {incr i} {
  6330. +         set    c        [string index $buffer $i]
  6331. +         if {$intoken} {
  6332. +         if {([string length $token] == 0) && ($c == "/")} {
  6333. +             set    intoken    -1
  6334. +             continue
  6335. +         }
  6336. +         if {$c != ">"} {
  6337. +             append    token    $c
  6338. +             continue
  6339. +         }
  6340. +         set    command    [string tolower $token]
  6341. +         set    pos    $intoken
  6342. +         set    intoken    0
  6343. +         set    token    ""
  6344. +         if {$command == "comment"} {
  6345. +             if {[incr incomment $pos] < 0} {
  6346. +             set    incomment    0
  6347. +             }
  6348. +             if {$incomment > 0} {    continue }
  6349. +         }
  6350. +         if {$command == "lt"} {
  6351. +             append    output    [set lasto "<"]
  6352. +             continue
  6353. +         }
  6354. +         if {($command == "nl") || ($command == "np")} {
  6355. +             append    output    "\n"
  6356. +             set        lasto    " "
  6357. +             continue
  6358. +         }
  6359. +         if {[string length $output]} {
  6360. +             set    size    [expr $env(bigger)-$env(smaller)]
  6361. +             if {$size > 0} {
  6362. +                 set    font    "big"
  6363. +             } else {
  6364. +                 if {$size < 0} {
  6365. +                 set    font    "small"
  6366. +                 } else {
  6367. +                 set    font    ""
  6368. +                 }
  6369. +             }
  6370. +             if {$env(fixed) > 0} {
  6371. +                 append    font    "fixed"
  6372. +             } else {
  6373. +                 if {$env(bold) > 0} {
  6374. +                 append    font    "bold"
  6375. +                 }
  6376. +                 if {$env(italic) > 0} {
  6377. +                 append    font    "italic"
  6378. +                 }
  6379. +             }
  6380. +             set    tags    [list $font]
  6381. +             if {$env(underline) > 0} {
  6382. +                 append    tags    underline
  6383. +             }
  6384. +             insertWithTags    $w.text $output $tags
  6385. +             set    output        ""
  6386. +             set    lasto        " "
  6387. +         }
  6388. +         catch    {
  6389. +             if {[incr env($command) $pos] < 0} {
  6390. +             set $env($command) 0
  6391. +             }
  6392. +         }
  6393. +         continue
  6394. +         }
  6395. +         if {$c != "<"} {
  6396. +         if {!$incomment} {
  6397. +             append    output    [set lasto $c]
  6398. +         }
  6399. +         continue
  6400. +         }
  6401. +         set    intoken        1
  6402. +     }
  6403. +     }
  6404. +     insertWithTags $w.text    $output
  6405. + }
  6406. + # The procedure below inserts text into a given text widget and
  6407. + # applies one or more tags to that text.  The arguments are:
  6408. + #
  6409. + # w        Window in which to insert
  6410. + # text        Text to insert (it's inserted at the "insert" mark)
  6411. + # args        One or more tags to apply to text.  If this is empty
  6412. + #        then all tags are removed from the text.
  6413. + proc insertWithTags {w text args} {
  6414. +     set start [$w index insert]
  6415. +     $w insert insert $text
  6416. +     foreach tag [$w tag names $start] {
  6417. +     $w tag remove $tag $start insert
  6418. +     }
  6419. +     foreach i $args {
  6420. +     $w tag add $i $start insert
  6421. +     }
  6422. + }
  6423. + richtext
  6424. + wm withdraw .
  6425.